Changing how keys are stored in keyed matrices