Added motor multithread stuff