Added most efficient version.
Init: playing with the state monad yet again