foreach exercise with nested array