Improved getSection

Improved getSection, it now selects a section based on a range.