Pass an argument into a function to extract from array

Pass an argument into a function to extract from array