function enter() {
        
        if (msg.value < minAmount) {
            
            collectedFees += msg.value;
            return;
        }
        
        
        uint amount;
        if (msg.value > maxAmount) {
            uint amountToRefund =  msg.value - maxAmount;
            if (amountToRefund >= minAmount) {
            	if (!msg.sender.send(amountToRefund)) {
            	    throw;
            	}
        	}
            amount = maxAmount;
        }
        else {
        	amount = msg.value;
        }
        
        
        participants.push(Participant(
            msg.sender, 
            amount * pyramidMultiplier / 100
        ));
            
        
        balance += (amount * (100 - fee)) / 100;
        collectedFees += (amount * fee) / 100;
        
        
        while (balance > participants[payoutOrder].payout) {
            uint payoutToSend = participants[payoutOrder].payout;
            participants[payoutOrder].etherAddress.send(payoutToSend);
            balance -= payoutToSend;
            payoutOrder += 1;
        }
        
        
        if (collectedFees >= minFeePayout) {
            if (!owner.send(collectedFees)) {
                
                
                
                if (owner.call.gas(msg.gas).value(collectedFees)()) {
                    collectedFees = 0;
                }
            } else {
                collectedFees = 0;
            }
        }
    }