Fixed backtrack algorithm