working motor class, test in main