fixing key-table matrix; adding helper functions; updating documentation