Moving header functions to main.h