Add utility method fromArray