Update main.c

Updated main while loop.