Add toArray() for read access to internal array