fixed ranged some more and did some refactoring