fixed efficiency problem with printing