Fixed printer bug and added comments