trying to turn array into array of objects