fix bugs in Rec; add function inlining; not complete yet;
merge