change matrix and vector api