Build matrix2 class