added protection against multiple inclusion

added #ifndef/define stuff in functions.h