Added max distance option to wsearch