function bid(uint256 _wave, uint256 _tokenId) external payable whenNotPaused {
        
        require(ethernautsStorage.ownerOf(_tokenId) == address(this));

        
        require(countdowns[_wave] >= now);

        
        bool existInWave = false;
        for (uint256 i = 0; i < waveToTokens[_wave].length; i++) {
            if (waveToTokens[_wave][i] == _tokenId) {
                existInWave = true;
                break;
            }
        }
        require(existInWave);

        address oldBuyer = tokenToBuyer[_tokenId];
        uint256 sellingPrice = ethernautsStorage.priceOf(_tokenId);

        
        require(msg.sender != address(0));

        
        require(msg.value > sellingPrice);

        
        sellingPrice = msg.value;

        
        uint256 newPrice = SafeMath.div(SafeMath.mul(sellingPrice, bonus[_wave]), percBase);

        
        tokenToLastPrice[_tokenId] = sellingPrice;
        ethernautsStorage.setPrice(_tokenId, newPrice);
        tokenToBuyer[_tokenId] = msg.sender;

        
        if (oldBuyer != address(0)) {
            oldBuyer.transfer(tokenToLastPrice[_tokenId]);
        }

        Bid(_tokenId, sellingPrice, newPrice, oldBuyer, msg.sender);
    }