Newton's second law of motion

Homework Statement

If m1=m2=1.0 kg and θ=30°, what will be the acceleration of the system? Calculate the tension in the cord, if a block m1 lying on a frictionless inclined plane and is connected to a mass less cord. Assume m1 is moving down the plane for A), and for B) m1 is in the opposite direction. C) If m1= 1 kg and θ=30°, and the system remains at rest, what must the mass of m2 be? Calculate the tension.

Homework Equations

ƩF=ma

The Attempt at a Solution

For part A
I have this so far
m1 x: ƩF=mg(sin30°)-T=ma
T=mg(sin 30°)/ma
y: ƩF=N-mg(cos 30°)=0
N=mg(cos 30°)
m2 y: T-mg=ma
T=ma+mg
T1=T2
therefore, ma+mg=(g(sin 30°))/a
so to solve for a I end up getting
a2+ ga - gsin30°=0
so do I just do the quadratic formula here or am I going the wrong way about it?