finish the printer function