Added notes for explanation of functions