.
trying state monad
seems to be working again