Cleaned up main.c