```ruby
lines.each do |line|
```

looks like easier to go though the lines array, isn't it?