Using state, rather than a writer.

Although this could be StateT(Writer)