3d array comparison