Added function for checking if value in an array.