Simplifies recursive function
Gets array values