added functions.h and began change of program structure