better tree comparsion from Issue #28