calculate_curve and calculate_rfactor updated