fixing the calculate function call