change update_mat to compute_updated_state