fixed floating point rounding error
completed optimizer