minor refactoring, tried adding max-p formula for addition but clashed with fudge factor, so reverted