Functions fix, missing files added