change nested loop to if gen and replace if(xy[i]) o +=xy[i] in hamming.v