Added code for handling 4 motors