Improved main.c