mods to genericWriter printstats() plus have added test for this func.