limit to 0.999 to avoid div by 0