Added motor controller code