updated rounding function