fixed the rounding function