new logic for testing ranges, and more ranges from @joshdata