Implemented a multi-dimensional version of ComputeChildren