replacing file writes to use fancyPrint