code for printing