Edited motors, threads related code