add fixed version of matrix_keypad code