Start recursive part for UP and finished the first version; still buggy;