writing printer functions