# Enthalpy change for exothermic and endothermic reactions

I understood the concept behind endothermic and exothermic but finding it hard to understand it numerically.Let me describe my confusion through example.

Suppose for a reaction,
reactants require energy=$\rm40~J$
which on forming product give energy=$\rm50~J$ (so yes it is exomthermic)
where change in enthaply=$\rm10~J$

But as per the equation: "Enthalpy change=Enthalpy of products- Enthalpy of reactants." since enthalpy at constant pressure is Total heat content. So I should have

Change in enthalpy=[U(internal energy)-50]-[U+40]=-90J

Could You explain it where I am getting this wrong? Is my understanding of enthalpy correct?