Revised array function.