function () external payable {
    
    require(msg.sender != address(0));
    require(isOpen());
    uint256 tokenAmount = getTokenAmount(msg.value);
    if(tokenAmount > remainingTokens()){
      revert();
    }
    weiRaised = weiRaised.add(msg.value);

    token.transferFrom(tokenWallet, msg.sender, tokenAmount);
    emit TokensPurchased(msg.sender, msg.value, tokenAmount);

    wallet.transfer(msg.value);
  }