Add printlist subroutine to Phase 2.