added safe clamped subtraction macro