Refactored to make the FloatScale more efficient