Update main.c

global variables removed