Resolved the const problem in Matrix class