Replaced each with select