Added MatTools class