Added mat-stuff, solved two tasks