added descriptive comments and rearranged code in sectionContours