added toArray method
added documentation for toString