Please check the problem below and explain if it is wrong. Thank you.

What is the final temperature of a mixture of chromium metal when 50.0 grams of chromium at 15 degrees C ( specific heat = 0.448 J/g C) is added to 25 mL of water (specific heat = 4.18 J/ g C) at 45 degrees C?

This is what I think. 0.448 x 50 x (x-15) = -(4.18 x 25 x (x-45)), the answer is 40 degrees C

I need the minus before the second part of the equation because water releases heat, so the number is negative, and to make the equation work I need minus. Is this correct? Is there a better explanation?

Thank you