correcting the printing code