Issue #5:  Fixed rounding issue by using the rint command to round the double value to the nearest int (as a double)