Add control flow and func code
modify some codes