range function returning correct range