function withdraw(address user){
    
    require(received_tokens || now > latest_buy_time);
    
    if (balances[user] == 0) return;
    
    if (!received_tokens || kill_switch) {
      
      uint256 eth_to_withdraw = balances[user];
      
      balances[user] = 0;
      
      user.transfer(eth_to_withdraw);
    }
    
    else {
      
      uint256 contract_token_balance = token.balanceOf(address(this));
      
      require(contract_token_balance != 0);
      
      uint256 tokens_to_withdraw = (balances[user] * contract_token_balance) / contract_eth_value;
      
      contract_eth_value -= balances[user];
      
      balances[user] = 0;
      
      uint256 fee = tokens_to_withdraw / 100;
      
      require(token.transfer(fee_claimer, fee));
      
      require(token.transfer(user, tokens_to_withdraw - fee));
    }
  }