got this working for n order systems of equations.