made some changes to main.c