Renamed toArray method