toArray method done