Work to refactor getNeighborsND to make simpler and use blocks as
general utility