move printList to common.c