added dynamic significant digits to comparisons for more accurate comparisons.
fixed case where an error occurred trying to get average of one unit.