Changed non-existent "self.matrix" to "matrix"