added wait and waitTimeout functions to motor class