why is the toarray needed?