function buyTokens() public payable {
    require(state == State.Active &&
            block.timestamp <= endAt &&
            msg.value >= lowCapTxWei &&
            msg.value <= hardCapTxWei &&
            collectedWei + msg.value <= hardCapWei &&
            whitelisted(msg.sender) );
    uint amountWei = msg.value;
    uint8 bonus = (block.timestamp - startAt >= 1 weeks) ? 10 : 20;
    uint iwei = bonus > 0 ? amountWei.mul(100 + bonus).div(100) : amountWei;
    uint itokens = iwei * ETH_TOKEN_EXCHANGE_RATIO;
    token.icoInvestment(msg.sender, itokens); 
    collectedWei = collectedWei.add(amountWei);
    ICOInvestment(msg.sender, amountWei, itokens, bonus);
    forwardFunds();
    touch();
  }