added algos for ranges