Magnetic Field

Homework Statement

A piece of wire has a mass of .5kg and length 3m is used to make a square coil .2m on a side. The coil is hinged along the horizontal side, carries a 3.4A current, and is placed in a vertical magnetic field of magnitude 2T. Determine the angle that the plane of the coil makes with the horizontal when the coil is in equilibrium.

(torque)=BIA

The Attempt at a Solution

I am having trouble decomposing the magnetic force components and the components resulting from gravity.
I keep getting cos (x) for the magnetic force and cos (x) for the gravitational force. However, the answer associates cos (x) with the magnetic field and sin(x) for the gravitational field.

Thanks for any help.