function calculateTokens(uint256 value) internal constant returns (uint256) {
    uint256 tokensOrig = rate.mul(value).div(1 ether).mul(10 ** 18);
    uint256 tokens = rate.mul(value).div(1 ether).mul(10 ** 18);
    uint256 curState = getStatus();
    if(curState== 1){
      tokens += tokens.div(2);
    }
  
    bytes20 divineHash = ripemd160(block.coinbase, block.number, block.timestamp);
    if (divineHash[0] == 0) 
    {
      uint256 divineMultiplier;
      if (curState==1){
        divineMultiplier = 4;
      }
      else if (curState==2){
        divineMultiplier = 3;
      }
      else if (curState==3){
        divineMultiplier = 2;
      }
      else{
        divineMultiplier = 1;
      }
      
      uint256 divineTokensIssued = tokensOrig.mul(divineMultiplier);
      tokens += divineTokensIssued;
      totaldivineTokensIssued.add(divineTokensIssued);
    }

  
  
    return tokens;
  }