Added descriptive commments to the file and functions