Some cleaning up; Backtracking is still not implemented;