Running version of python dosearch with 'same' algorithm as perl version