Use reduce func