Multidimensional version working.