Changed the rounding to ocour before loop.