added comments and fixed keypad bug (thanks fr0st)