function withdraw() public {
    require(hodlers[msg.sender].canWithdrawPeriod != 0);
    require(hodlers[msg.sender].canWithdrawPeriod < currentPeriod);

    hodlers[msg.sender].canWithdrawPeriod = currentPeriod;
    uint256 payment = prevBalance / prevHodlers;
    prevHodlers -= 1;
    prevBalance -= payment;
    msg.sender.send(payment);
    Withdrawal(msg.sender, currentPeriod-1, payment);
  }