implement readKey() (closes #2)