correction of the calculation

The previous formula was wrong for me. I added a module to avoid going too far.