Added simple handling of acceleration/deceleration