fixed teh formulae