removed findRightNestingEnd