Additional comments

Included more explanations of function.