Fixed faulty speed and acceleration logic