added method asArray()