modified main.c