main.c: modify code for project