Changes to the algorithm structure