Changed the output from an array to an object with named array children