Added code for simulating motors