update API, update algorithm for matrix multiplication