Switch to state monad, implement sequencer