added max_jerk variable