Added toArray() method.
Formatting.