added state monad implementation

sup :smile: