fixes #158 - rounding errors