Use range
Merge pull request #7 from methane/refactoring

Use range