trying to get the function to return an array