Updated for invariant mass calculation