one last tweak to xp alg