Having problems with my array function.