cleanup main.c