Done with both the heuristic and the backtrack algorithm implementations