I need help with a little code entry pad.

actually, wait a second, if the first one wasnt set to 9 it wouldnt go through each state to see if it was pressed.