Adapted fromArray