Algorithm changed