flatten.map => flat_map
Use Ruby 1.9 hash syntax