updated the print list method