Added .toArray() function