added function headers to the header file and formatted/commented