Added invariant mass calculation and tidied