added code for printing