agorithms fix bugs