add ifs to nextCalculation()