two functions to find if a value is in an array, and to compare values in two arrays