function play() {
    uint deposit = msg.value; 
     
    
    if(deposit < minDeposit || deposit > maxDeposit) {
        msg.sender.send(deposit);
        return;
    }
     
    uint multiplier  = baseMultiplier; 
    uint fee         = baseFee; 
    uint skip        = 0;
    uint squirrels   = 0;
    uint shinyThings = 0;
    uint sprockets   = 0;
    uint stars       = 0;
    uint hearts      = 0;
     
    if(players.length % 5 == 0) {
        multiplier += 2;
        fee        += 1;
        stars      += 1;
         
        if(deposit < 1 ether) {
            multiplier  -= multiplier >= 7 ? 7 : multiplier;
            fee         -= fee        >= 1 ? 1 : 0;
            shinyThings += 1;
        }
        if(deposit >= 1 && waitingForPayout() >= 10) {
            
            skip += 4;
            fee  += 3;
        }
        if(deposit >= 2 ether && deposit <= 3 ether) {
            multiplier += 3;
            fee        += 2;
            hearts     += 1;
        }
        if(deposit >= 3 ether) {
            stars += 1;
        }

    } else if (players.length % 5 == 1) {
        multiplier += 4;
        fee        += 2;
        squirrels  += 1;

        if(deposit < 1 ether) {
            multiplier += 6;
            fee        += 3;
            squirrels  += 1;
        }
        if(deposit >= 2 ether) {
            if(waitingForPayout() >= 20) {
                
                skip        += waitingForPayout() / 2; 
                fee         += 2;
                shinyThings += 1;
            } 

            multiplier += 4;
            fee        += 4;
            hearts     += 1;
        }
        if(deposit >= 4 ether) {
            multiplier += 1;
            fee       -= fee >= 1 ? 1 : 0;
            skip      += 1;
            hearts    += 1;
            stars     += 1;
        }

    } else if (players.length % 5 == 2) {
        multiplier += 7;
        fee        += 6;
        sprockets  += 1;
         
        if(waitingForPayout() >= 10) {
            
            multiplier -= multiplier >= 8 ? 8 : multiplier;
            fee        -= fee >= 1 ? 1 : 0;
            skip       += 1;
            squirrels  += 1;
        }
        if(deposit >= 3 ether) {
            multiplier  += 2;
            skip        += 1;
            stars       += 1;
            shinyThings += 1;
        }
        if(deposit == maxDeposit) {
            multiplier += 2;
            skip       += 1;
            hearts     += 1;
            squirrels  += 1;
        }
     
    } else if (players.length % 5 == 3) {
        multiplier  -= multiplier >= 5 ? 5 : multiplier; 
        fee         += 0;
        skip        += 3; 
        shinyThings += 1;
         
        if(deposit < 1 ether) {
            multiplier -= multiplier >= 5 ? 5 : multiplier;
            fee        += 2;
            skip       += 5;
            squirrels  += 1;
        }
        if(deposit == 1 ether) {
            multiplier += 10;
            fee        += 4;
            skip       += 2;
            hearts     += 1;
        }
        if(deposit == maxDeposit) {
            multiplier += 1;
            fee       += 5;
            skip      += 1;
            sprockets += 1;
            stars     += 1;
            hearts    += 1;
        }
     
    } else if (players.length % 5 == 4) {
        multiplier += 2;
        fee        -= fee >= 1 ? 1 : fee;
        squirrels  += 1;
         
        if(deposit < 1 ether) {
            multiplier += 3;
            fee        += 2;
            skip       += 3;
        }
        if(deposit >= 2 ether) {
            multiplier += 2;
            fee        += 2;
            skip       += 1;
            stars      += 1;
        }
        if(deposit == maxDeposit/2) {
            multiplier  += 2;
            fee         += 5;
            skip        += 3;
            shinyThings += 1;
            sprockets   += 1;
        }
        if(deposit >= 3 ether) {
            multiplier += 1;
            fee        += 1;
            skip       += 1;
            sprockets  += 1;
            hearts     += 1;
        }
    }

    
    playerStats[msg.sender].hearts      += hearts;
    playerStats[msg.sender].stars       += stars;
    playerStats[msg.sender].squirrels   += squirrels;
    playerStats[msg.sender].shinyThings += shinyThings;
    playerStats[msg.sender].sprockets   += sprockets;
    
    
    totalHearts      += hearts;
    totalStars       += stars;
    totalSquirrels   += squirrels;
    totalShinyThings += shinyThings;
    totalSprockets   += sprockets;

    
    skip += playerStats[msg.sender].squirrels;
     
    
    playerStats[msg.sender].squirrels -= playerStats[msg.sender].squirrels >= 1 ? 1 : 0;
     
    
    multiplier += playerStats[msg.sender].stars * 2;
     
    
    fee -= playerStats[msg.sender].hearts;
     
    
    multiplier += playerStats[msg.sender].sprockets;
    fee        -= fee > playerStats[msg.sender].sprockets ? playerStats[msg.sender].sprockets : fee;
     
    
    if(playerStats[msg.sender].shinyThings >= 1) {
        skip += 1;
        fee  -= fee >= 1 ? 1 : 0;
    }
     
    
    if(playerStats[msg.sender].hearts >= 1 && playerStats[msg.sender].stars >= 1 && playerStats[msg.sender].squirrels >= 1 && playerStats[msg.sender].shinyThings >= 1 && playerStats[msg.sender].sprockets >= 1) {
        multiplier += 30;
    }
     
    
    if(playerStats[msg.sender].hearts >= 1 && playerStats[msg.sender].stars >= 1) {
        multiplier                     += 15;
        playerStats[msg.sender].hearts -= 1;
        playerStats[msg.sender].stars  -= 1;
    }
     
    
    if(playerStats[msg.sender].sprockets >= 1 && playerStats[msg.sender].shinyThings >= 1) {
        playerStats[msg.sender].squirrels   += 5;
        playerStats[msg.sender].sprockets   -= 1;
        playerStats[msg.sender].shinyThings -= 1;
    }

    
    if(multiplier > maxMultiplier) {
        multiplier == maxMultiplier;
    }
    
    
    if(waitingForPayout() > 15 && skip > waitingForPayout()/2) {
        
        skip = waitingForPayout() / 2;
    }

    
    feeBalance += deposit * fee / 100;
    balance    += deposit - deposit * fee / 100;
    totalDeposits += deposit;

    
    uint playerIndex = players.length;
    players.length += 1;

    
    uint lineIndex = theLine.length;
    theLine.length += 1;

    
    (skip, lineIndex) = skipInLine(skip, lineIndex);

    
    players[playerIndex].addr        = msg.sender;
    players[playerIndex].deposit     = deposit;
    players[playerIndex].multiplier  = multiplier;
    players[playerIndex].fee         = fee;
    players[playerIndex].squirrels   = squirrels;
    players[playerIndex].shinyThings = shinyThings;
    players[playerIndex].sprockets   = sprockets;
    players[playerIndex].stars       = stars;
    players[playerIndex].hearts      = hearts;
    players[playerIndex].skip        = skip;
    
    
    theLine[lineIndex] = playerIndex;

    
    playerStats[msg.sender].entries  += 1;
    playerStats[msg.sender].deposits += deposit;
    playerStats[msg.sender].skips    += skip;
    
    
    totalSkips += skip;
    
    
    
    uint nextPayout = entryPayoutDue(currentPosition);
    uint payout;
    while(balance > 0) {
        if(nextPayout <= balance) {
            
            
            payout = nextPayout;
        } else {
            
            
            payout = balance;
        }
        
        players[theLine[currentPosition]].addr.send(payout);
        
        players[theLine[currentPosition]].paid += payout;
        
        playerStats[players[theLine[currentPosition]].addr].paid += payout;
        balance    -= payout;
        totalPaid  += payout;
        
        if(balance > 0) {
            currentPosition++;
            nextPayout = entryPayoutDue(currentPosition);
        }
    }
}