Cleaning up Motor Control code and adding comments.