Refactoring
Refactoring
Refactoring
Trying to add support for overlapping ranges