Logic for grabbing names in an array