I'm curious why you have a `names` object for checking duplicate names, as opposed to just using `array.indexOf()' against the `result` array?