motor control functions added and UI finished