added printList() for debugging