adding function to center a matrix
committing previous chagnes