setting the ranges of a function