Simple backtracking search