algorithm: modified-binary-search: adding code for modified binary search