first single-pass version
first working state machine version
cleanup
purely functional version of zzz
remove \n
rename zzz
relocate substring function and add "docstring"