I think one of the reasons you're having trouble is that array feels too difficult here. I think hash is the appropriate data type here. 

```ruby
def movies_by_year(movies)
  hash = {}
  movies.each do |movie|
    hash[movie.year] ||= []
    hash[movie.year] << movie
  end
  hash
end
```

ok, so now you have a hash by year, which is easier to deal with.

In ruby, the data-type most often reached for is the hash. arrays are generally pretty stupid and simple lists.