This creates a Range object that we don't need.  I *think* you can change to something like this:

```ruby
state_counter.upto(last_counter) do |count|
   ...
end
```

It may be off by one though, so you need to check.