fix the matrix init method, starting tests for it