change output to be an array of objects