Major rewrite

After some feedback, I decided that using a state machine was
unnessesary. Simplified things,