preliminary minimum degree added. some degree computations may be bugged but seems to be working on small matrices.