if out must be an Array, you should use `each_with_index` instead.
```ruby
out.each_with_index do |o, dex|
```