new files added, new structure of code in main.c