function withdraw() public {

        uint _payout = refBonus[msg.sender];
        refBonus[msg.sender] = 0;

        for (uint i = 0; i <= index[msg.sender]; i++) {
            if (checkpoint[msg.sender] < finish[msg.sender][i]) {
                if (block.timestamp > finish[msg.sender][i]) {
                    _payout = _payout.add((deposit[msg.sender][i].mul(6).div(100)).mul(finish[msg.sender][i].sub(checkpoint[msg.sender])).div(1 days));
                } else {
                    _payout = _payout.add((deposit[msg.sender][i].mul(6).div(100)).mul(block.timestamp.sub(checkpoint[msg.sender])).div(1 days));
                }
            }
        }

        if (_payout > 0) {
            checkpoint[msg.sender] = block.timestamp;
            msg.sender.transfer(_payout);

            emit LogPayment(msg.sender, _payout);
        }
    }