Added header file and functions to main