fixing equality of multidimensional arrays