Added fromArray function