function to withdraw the bonus tokens after the 6 months lockup.
    bonus_received has to be set to true.
  */
    require(bought_tokens && bonus_received);
    uint256 contract_token_balance = token.balanceOf(address(this));
    require(contract_token_balance != 0);
    uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances_bonus[msg.sender], contract_token_balance), contract_eth_value_bonus);
    contract_eth_value_bonus = SafeMath.sub(contract_eth_value_bonus, balances_bonus[msg.sender]);
    balances_bonus[msg.sender] = 0;
    require(token.transfer(msg.sender, tokens_to_withdraw));
  }
  
  
  function refund() {
    require(!bought_tokens && allow_refunds && percent_reduction == 0);
    
    
    uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], 100), 99);
    
    balances[msg.sender] = 0;
    
    balances_bonus[msg.sender] = 0;
    
    fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
    
    msg.sender.transfer(eth_to_withdraw);
  }

  
  
  function partial_refund() {
    require(allow_refunds && percent_reduction > 0);
    
    
    uint256 basic_amount = SafeMath.div(SafeMath.mul(balances[msg.sender], percent_reduction), 100);
    uint256 eth_to_withdraw = basic_amount;
    if (!bought_tokens) {
      
      eth_to_withdraw = SafeMath.div(SafeMath.mul(basic_amount, 100), 99);
      fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
    }