range function modification