function () public payable {
       require(!crowdsaleClosed);
       require(now < deadline);
       uint amount = msg.value;
       if (msg.sender != beneficiary) {
           require(msg.value >= 1 ether);
           amountRaised += amount;
           uint tokens = uint(amount * 10 ** uint256(8) / price);
           if (now < bonusPhaseOneDeadline) {
               tokens += ((phaseOneBonusPercent * tokens)/100 );
           } else if (now < bonusPhaseTwoDeadline) {
               tokens += ((phaseTwoBonusPercent * tokens)/100);
           } else if (now < bonusPhaseThreeDeadline) {
               tokens += ((phaseThreeBonusPercent * tokens)/100);
           }
           balanceOf[msg.sender] += tokens;
           remainingTokens -= tokens;
           tokenReward.transfer(msg.sender, tokens);
           FundTransfer(msg.sender, amount, true);
       }
       currentBalance += amount;
   }