add calculate() method and implements it