Uncommented motor drive code