Updated file with functions completed