implemented toArray methods