boys are just confusing

I've recently had to spend a lot of time with my ex (I know, not a desirable situation). Anyway, he has been acting really strange around me. He is kind and polite to everyone, but is a total jerk towards me. It's gotten to the point where other people have even commented on his odd behavior. Bear in mind, we haven't dated for 2 years and things didn't really end badly between us. Why is he acting like this?????