Recursive func compare

And some little changes