iterate array with each, added method explanation