added class matrix