fixed roundoff error issue #2