Fixed reversed ranges
Prevent huge arrays
Better code style
Merge pull request #8 from Mechazawa/rangefix

Rangefix