Added toArray methods