started the row-column reordering and overlapping code, partially done