function calculateAndTransferTokens() internal {
    
    invested = invested.add(msg.value);

    
    uint tokens = msg.value.mul(price).div(1 ether);
    uint bonus = getBonus();
    if(bonus > 0) {
      tokens = tokens.add(tokens.mul(bonus).div(100));      
    }
    
    
    mintAndSendTokens(msg.sender, tokens);
  }