fixed off by ones, range counts work