Improved motor control