moved motorstate into state