this prunes the search tree considerably and fixes a speed regression introduced in an earlier commit.