Solve for x and y simultaneously