simple implementation of backtracking search for solving CSP