Add reference to best solution
Refactor logic to test if better solution was found