Implemented first version of motion control.