debugging matrices