backtracking

final version?