Build class matrix3