Small refactor
Refactor range function
Merge branch 'issue-125' into issue-121