fixed matrix resize, reorganized inteface, matrix transpose