Added comments

Labelled each function and created a new header at the top of the file