fixed extern declarations in main.c