Added configurable precision
Fixed rounding