fixed issued with kmatrix + added some more funcs