Change the Matrix from class to structure