started implementation state monad