Update main.c

partially fix issue 8