stats algorithm ok