First multidimensional implmentation - not fully parallelized