added non-exhaustive switching search