fix li bug
optimize recursive function
optimize recursive