matlab code now does partition and computes cut size