seems to work, but fix up the output a bit...