Update main.c

updated init lister and fixed the while loop in main