making range() more flexible