Not getting how exes find friendship.

Do these types of friendships start well before the divorce? "I don't feel the magic anymore, let's divorce. Good idea, I feel the same. But we can always be friends! Oh, I would like that!"

Or does the hatchet get buried at some point? "I hate your guts! I hate YOUR guts! But junior is graduating next year. Yeah, we should show solidarity!"

How does this work?