more notes/code on matrix settling