Need to find a way to indexOf because it does not seem to work for the multidimensional array