function chase() private {
        
        
        uint dValue = 100 finney;
        if (msg.value > maxDeposit * 1 ether) {
            
        	msg.sender.send(msg.value - maxDeposit * 1 ether);	
        	dValue = maxDeposit * 1 ether;
        }
        else { dValue = msg.value; }

        
        addNewDonkey(msg.sender);
        
        
        entries.push(Entry(msg.sender, dValue, (dValue * (multiplier) / 100), false));
           
        
        balance += (dValue * (100 - fee)) / 100;
        donkeysInvested += dValue;
        donkeys[msg.sender].invested += dValue;
        
        
        
        uint index = ranking.length - 1;
        uint newEntry = donkeys[msg.sender].invested;
        bool done = false;
        bool samePosition = false;
        uint existingAt = ranking.length - 1;

        while (ranking[index].invested < newEntry && !done)
        {
            if (index > 0)
            {
                done = donkeys[ranking[index - 1].addr].invested > newEntry;
                
                if (ranking[index].addr == msg.sender)
                    existingAt = index;
                
                if (done)
                {
                    if (ranking[index].addr == msg.sender)
                    { 
                        ranking[index] = donkeys[msg.sender];
                        samePosition = true;
                    }
                }
              
                if (!done) index--;
            }
            else
            {
                done = true;
                index = 0;
                if (ranking[index].addr == msg.sender || ranking[index].addr == address(0x0))
                {
                    ranking[index] = donkeys[msg.sender];
                    samePosition = true;
                }
            }
            
        }
        
        if (!samePosition)
        {
            rankDown(index, existingAt);
            ranking[index] = donkeys[msg.sender];
        }
        
        
        
        while (balance > entries[payoutOrder].payout) {
            
            uint payout = entries[payoutOrder].payout;
            
            entries[payoutOrder].entryAddress.send(payout);
            entries[payoutOrder].paid = true;

            balance -= payout;
            
            carrots++;
            payoutOrder++;
        }
        
        
        uint fees = this.balance - balance;
        if (fees > 0)
        {
            if (entries.length >= 50 && entries.length % 5 == 0)
            {
                fees = dValue * fee / 100;
                uint luckyDonkey = rand(eligibleForFees) - 1;
                
                if (ranking[luckyDonkey].addr != address(0x0))
                    ranking[luckyDonkey].addr.send(fees);
                else
                    donkeyKing.send(fees);
            }
            else
                pig.send(fees);
        }        
        
        
        if (donkeys[msg.sender].invested > investmentRecord)
        {
            donkeyKing = msg.sender;
            NewKing(msg.sender);
            investmentRecord = donkeys[msg.sender].invested;
            
        }
        
        if (ranking[0].addr != donkeys[donkeyKing].addr && ranking[0].addr != address(0x0))
        {
            ranking[1] = donkeys[ranking[0].addr];
            ranking[0] = donkeys[donkeyKing];
        }
        
    }