taking care of inverted tree special case