Tested the code and indeed it does not work. Upon further investigation I found 2 issues.
First:
The following does not activate the internal pullup resistors.
digital.pinMode(21, INPUT_PULLUP, RISING);//pin, mode, type
digital.pinMode(22, INPUT_PULLUP, RISING);//pin, mode, type
You...