//go through the entire matrix
for (int x = 0; x < numSeqs; x++) {
for (int y = 0; y < numSeqs; y++) {
//if have not changed groups
if ((x < countx) && (y < county)) {
//go through the entire matrix
for (int x = 0; x < numSeqs; x++) {
for (int y = 0; y < numSeqs; y++) {
//if have not changed groups
if ((x < countx) && (y < county)) {