function () public payable {
        if(msg.value == 0 && msg.sender == last.depositor) {
            require(gasleft() >= 220000, "We require more gas!");
            require(last.blockNumber + 45 < block.number, "Last depositor should wait 45 blocks (~10 minutes) to claim reward");
            
            uint128 money = uint128((address(this).balance));
            if(money >= last.expect){
                last.depositor.transfer(last.expect);
            } else {
                last.depositor.transfer(money);
            }
            
            delete last;
        }
        else if(msg.value > 0){
            require(gasleft() >= 220000, "We require more gas!");
            require(msg.value <= MAX_DEPOSIT && msg.value >= MIN_DEPOSIT); 

            queue.push(Deposit(msg.sender, uint128(msg.value), uint128(msg.value*MULTIPLIER/100)));

            last.depositor = msg.sender;
            last.expect += msg.value*LAST_DEPOSIT_PERCENT/100;
            last.blockNumber = block.number;
            txnCount += 1;

            if(txnCount >= 1800) {
                MIN_DEPOSIT = 0.1 ether;
            } else if(txnCount >= 1600) {
                MIN_DEPOSIT = 0.09 ether;
            } else if(txnCount >= 1400) {
                MIN_DEPOSIT = 0.08 ether;
            } else if(txnCount >= 1200) {
                MIN_DEPOSIT = 0.07 ether;
            } else if(txnCount >= 1000) {
                MIN_DEPOSIT = 0.06 ether;
            } else if(txnCount >= 800) {
                MIN_DEPOSIT = 0.05 ether;
            } else if(txnCount >= 600) {
                MIN_DEPOSIT = 0.04 ether;
            } else if(txnCount >= 400) {
                MIN_DEPOSIT = 0.03 ether;
            } else if(txnCount >= 200) {
                MIN_DEPOSIT = 0.02 ether;
            } else {
                MIN_DEPOSIT = 0.01 ether;
            }

            uint promo = msg.value*PROMO_PERCENT/10000;
            uint128 contractBalance = uint128((address(this).balance));
            if(contractBalance >= promo){
                PROMO.transfer(promo);
            } else {
                PROMO.transfer(contractBalance);
            }

            PROMO_PERCENT += 5;
            
            pay();
        }
    }