fixing bug with rounding error on rings