Adding matrix solution