function acceptEscrow(bytes32 escrowId) public whenNotPaused {
        address seller = escrowByEscrowId[escrowId].seller;
        require(seller != msg.sender);
        require(seller != address(0));

        address buyer = escrowByEscrowId[escrowId].buyer;
        bool isPublic = escrowByEscrowId[escrowId].publicE;
        if(!isPublic)
        {
            require(msg.sender == escrowByEscrowId[escrowId].buyer, "You are not authorized for this escrow.");
        }

        


        uint256[] memory assetIds = assetIdByEscrowId[escrowId];
        
        for(uint a = 0; a < assetIds.length; a++)
        {
            require(seller == nonFungibleRegistry.ownerOf(assetIds[a]));
        }
        
        uint escrowPrice = escrowByEscrowId[escrowId].price;
        
        if (publicationFeeInWei > 0) {
            if(!whitelistAddresses[msg.sender])
            {
                acceptedToken.transferFrom(
                msg.sender,
                owner,
                publicationFeeInWei
            );
            }
            
            if(!whitelistAddresses[seller])
            {
                acceptedToken.transferFrom(
                seller,
                owner,
                publicationFeeInWei
            );
            }
            
        }
        
        
        acceptedToken.transferFrom(
            msg.sender,
            seller,
            escrowPrice
        );
        
        for(uint counter = 0; counter < assetIds.length; counter++)
        {
            uint256 tempId = assetIds[counter];
            nonFungibleRegistry.safeTransferFrom(
            seller,
            msg.sender,
            tempId
            ); 
            
        }

        
        for(uint t = 0; t < escrowByOwnerId[seller].length; t++)
        {
            if(escrowByOwnerId[seller][t].id == escrowId)
            {
                delete escrowByOwnerId[seller][t];
            }
        }
        
        
        for(uint i = 0; i < assetIds.length; i++)
        {
            for(uint j = 0; j < allOwnerParcelsOnEscrow[seller].length; j++)
            {
                if(assetIds[i] == allOwnerParcelsOnEscrow[seller][j])
                {
                    delete allOwnerParcelsOnEscrow[seller][j];
                }
            }
        }


        delete escrowByEscrowId[escrowId]; 
        delete assetIdByEscrowId[escrowId];

            emit EscrowSuccessful(
            escrowId,
            seller,
            escrowPrice,
            buyer
        );

    }