Added a method to destroy the matrix