Function for tree node cousin