Added keypress, win, and lose functions.