Added solving, added sumdegree, works for 2nd degree