Added comments explaining the functions contained in the file.