Demo implementation of setRanges() function.