finding the range of a function