updating solve p_cn to two level