Changed initial state building to a monad action rather than an input