scratching around for logic to output tables