Everytime a girl mentions her ex, on the surface i ignore/ act like i couldn't care less. However sometimes I compare them in my mind, in most cases I'm better in every way but I get annoyed, is this an ego problem? E.g. I would wonder "How did a guy uglier than me bag this chick and then dumped her. Why am I, who's a superior male than him, picking up the leftover of a lesser guy?" (Don't get me wrong the chick is hot)

Does anyone else have this thought before? If so, how did you come to peace with it ?