Performance improvements for motor breaking - not tested code