Added line to force return value of optimalSize to an integer when greater than minimum value.