Adapt to new algorithm