Update Z_cw.m