added additional commentary describing code function