updated motor code and added encoder test