Initial attempt at a State monad