Updated algorithm

Using the title in the algorithm to select better.