Tuned the algorithm comparing