   pinMode(RIGHT_DIRECTION, OUTPUT);
   pinMode(RIGHT_SPEED, OUTPUT);
   
-  attachInterrupt(digitalPinToInterrupt(2), handleLeftTick, CHANGE);
-  attachInterrupt(digitalPinToInterrupt(3), handleRightTick, CHANGE);
+  attachPinChangeInterrupt(M1_A, leftAChange, CHANGE);
+  attachPinChangeInterrupt(M1_B, leftBChange, CHANGE);
+  attachPinChangeInterrupt(M2_A, rightAChange, CHANGE);
+  attachPinChangeInterrupt(M2_B, rightBChange, CHANGE);
 
   Serial.print("Time\tLeft Target\tLeft Speed\tLeft Cum Error\tLeft Motor");
   Serial.print("\tRight Target\tRightSpeed\tRight Cum Error\tRightMotor");

const int RIGHT_SPEED = 6;
const int RIGHT_DIRECTION = 7;

// Minimum motor control value. Motor output below this will stall.
const int MIN_MOTOR_CMD = 60;


// and adjusts the target speeds depending on whether the user is pressing
// switches S2 through S5, as indicated in the code below.
void loop() {
  delay(15);

  unsigned long curLoopTime = micros();
  noInterrupts();
