 	delay(2000);
 	ArduinoStateMachine.transitionTo(Standby);
 }
+
+void motorStartState(){
+	digitalWrite(motorPin, HIGH);
+}
 void motorTestState(){
-	digitalWrite(motorPin, HIGH);
+	
 	//delay(1000);
-	digitalWrite(motorPin, LOW);
+	
 	//ArduinoStateMachine.transitionTo(Standby);
 	checkKeyboard();
+}
+void motorStopState(){
+	digitalWrite(motorPin, LOW);
 }
 
 //function that reads does some debugging and show-off for the keyboard


State Standby = State(standbyState);
State Processing = State(processingState);
State MotorTest = State(motorTestState);

FSM ArduinoStateMachine = FSM(Standby);


	}
}

void motorStop(){ 
	
	if (ArduinoStateMachine.isInState(MotorTest)){
		digitalWrite(ledPin, !digitalRead(ledPin)); //toggle led to show the motor just rotated
		ArduinoStateMachine.immediateTransitionTo(Standby); //TODO: might not be safe; will always transfer to Standby, even if motor is not running?
															//UPDATE: Fixed, now checking if in state where motor can run (maybe add other states where motor might run?)
	}
}
// Taking care of some special events.
void keypadEvent(KeypadEvent key){
