Using the correct array elements to update the name