Added method toArray()