bug fixed, matrix A,B done, tested