Rewrote main.c