added functions folder and partially modernized the header