optimize speed changing