Added a printList function and test.