Changed the way of passing win_mat