Updated Motor Controller Code