changed calculateTime parameters