http://en.wikipedia.org/wiki/Backtracking