Adding comments

Comments added to explain goal of functions.