changed get-local-matrix to map, etc