add keypad logic