matrix debug added