Moving C code to main_c.c to make coding easier.