Adding matrix classes, debugging triangle drawing bug