fixes precision errors