Adding acceleration and deceleration