fromArray method