added pointer to array function