fixed the binary search and added tests. also added comments and interpolated the 2d search