added stop_accel_pos variable and helper function.