move range_order and range_counter up in scope
Basic next/prev functionality as per Issue #2, still testing