State machine yay