finished code to update key state (by answering or un-answering a question