Updated the file with the function in comments