Added a basic implementation for what we can use as a FSM. Ths isn't a true FSM, but should work for what we need it to do.