fixed floating point error in balance factor