added some comments. added checkIfNecessary() to sectionContours, but can not get it to work properly (commented out for now)