I would rather you use map here; though I'm having a bit of trouble reading what you're doing here. I THINK you're trying to get the first year and last year of movies in the movies, right? If so, maybe try sorting them by year and pulling the first and last.