 }
 
 /**
- * Main loop method
- * @param none
- * @return void
- */
+   Main loop method
+   @param none
+   @return void
+*/
 void loop() {
   /**for(int i=0; i<8; i++){
     Serial.print("Y");

}

/**
 * Method to shift the registers to a matrix column
 * @param pColumn the column you wish to shift to.
 * @return void
 */
void shiftToColumn(int pColumn){
  digitalWrite(latchPin, LOW);
  if(pColumn <8){
    shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn]);
    shiftOut(dataPin, outClkPin, MSBFIRST, blank);
    shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn]);
  }else{
    shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn%8]);
    shiftOut(dataPin, outClkPin, MSBFIRST, mask[pColumn%8]);
    shiftOut(dataPin, outClkPin, MSBFIRST, blank);
  }
  digitalWrite(latchPin, HIGH);

    Serial.print(sValue[1]);
    Serial.print(" ");
    Serial.println(sValue[0]);
    }*/
  for (int i = 0; i < 16; i++) {
    shiftToColumn(i);
    scanRows();
    for (int j = 0; j < sizeof(rowsRead) / sizeof(bool); j++) {
      if (i < 12 and j < 12) {
        if (rowsRead[j] && !keyState[i + 12 * j]) {
          keyState[i + 12 * j] = 1;
          /*if((i+12*j)%2==0){
            keyState[i+12*j+1]=1;
            }else{
            keyState[i+12*j-1]=1;
            }*/
          if ((i + 12 * j) % 2 == 0) {
            if (keyState[i + 12 * j + 1] == 1) {
              midiSend(noteOn, keyMidi[i + 12 * j], getVelocity((i + 12 * j) / 2));
            } else {
              updateVelocity((i + 12 * j) / 2, (byte)1);
            }
          } else {
            if (keyState[i + 12 * j - 1] == 1) {
              midiSend(noteOn, keyMidi[i + 12 * j], getVelocity((i + 12 * j) / 2));
            }
            else {
              updateVelocity((i + 12 * j) / 2, (byte)1);
            }
          }
          /*Serial.print("Column ");
            Serial.println(i);
            Serial.print("Row ");
            Serial.println(j);*/
        } else {
          if (keyState[i + 12 * j] && !rowsRead[j]) {
            /*keyState[i + 12 * j] = 0;
              midiSend(noteOff, keyMidi[i + 12 * j], 0);*/
            keyState[i + 12 * j] = 0;
            if ((i + 12 * j) % 2 == 0) {
              if (keyState[i + 12 * j + 1] == 0) {
                updateVelocity((i + 12 * j) / 2, (byte)0);
                midiSend(noteOff, keyMidi[i + 12 * j], 0);
              }
            } else {
              if (keyState[i + 12 * j - 1] == 0) {
                updateVelocity((i + 12 * j) / 2, (byte)0);
                midiSend(noteOff, keyMidi[i + 12 * j], 0);
              }
            }
          }
        }
      }
      else {
        //The other buttons..
      }
    }
