main.c modified