Completion of the code, and correction of the algorithm of compare