function() public payable {
        require(!ico_finish);
        require(block.timestamp < fundingEndTime);
        require(msg.value != 0);

        totalEthInWei = totalEthInWei + msg.value;
        uint256  amount = 0;
        uint256 tokenPrice = unitsOneEthCanBuy;

        if (block.timestamp < preIcoFinishTimestamp) {
            require(msg.value * tokenPrice * 13 / 10 <= (preIcoTotalSupply - preIcoSupply));

            tokenPrice = safeMul(tokenPrice,13);
            tokenPrice = safeDiv(tokenPrice,10);

            amount = safeMul(msg.value,tokenPrice);
            preIcoSupply = safeAdd(preIcoSupply,amount);

            balances[msg.sender] = safeAdd(balances[msg.sender],amount);
            totalSupply = safeAdd(totalSupply,amount);

            emit Transfer(contractAddress, msg.sender, amount);
        } else {
            require(msg.value * tokenPrice <= (IcoTotalSupply - IcoSupply));

            amount = safeMul(msg.value,tokenPrice);
            IcoSupply = safeAdd(IcoSupply,amount);
            balances[msg.sender] = safeAdd(balances[msg.sender],amount);
            totalSupply = safeAdd(totalSupply,amount);

            emit Transfer(contractAddress, msg.sender, amount);
        }
    }