fixed how range was defined