Need to override toArray() for this to work