added option to customize output format

somewhat crude, but probably sufficient