improve printer; fix bugs