Optimisation fix in exhaustive search
Initial (bad) implementation of three steap search