Wrapped Backtracking algorithm in order to use Dictionary