#61 added updateKMatrix method