You shouldn't use Ranges.get() directly, you should accept it as an argument, and read it out at the very beginning of the algorithm.