Update main.c

Update includes:
- Global/local variable separation