set up system of equations