Not finished implementation of FSM