renaming to cmat and wmat