function () payable public {
        require(reward != address(0));
        require(msg.value > 0);
        require(icoHasStarted);
        require(!icoHasClosed);
        require(valueInUSD != 0);
        require(canRecieveTokens[msg.sender]);
        if(block.timestamp < startTime.add(DAY)) {
            require(contributed[msg.sender].add(msg.value) <= MAXIMUM24H);
        }
        else {
            require(contributed[msg.sender].add(msg.value) <= MAXIMUM);
        }

        if(contributed[msg.sender] == 0) {
            participantIndex[nextParticipantIndex] = msg.sender;
            nextParticipantIndex += 1;
        }

        contributed[msg.sender] = contributed[msg.sender].add(msg.value);
        currentAmountRaised = currentAmountRaised.add(msg.value);
        uint256 tokens = tokensToMint(msg.value);

        if(currentAmountOfTokens.add(tokens) >= maxAmountOfTokens) {
            icoHasClosed = true;
        }

        reward.mintTokens(msg.sender, tokens);
        currentAmountOfTokens = currentAmountOfTokens.add(tokens);
        Received(msg.sender, msg.value);
        TokensGiven(msg.sender, tokens);

        if(this.balance >= 100 ether) {
            if(!recipient.send(this.balance)) {
                ErrorReturningEth(recipient, this.balance);
            }
        }
    }