Adds higher-dimensional generalization of bsearch