I used to have sexual thought for my friends. After counselling with doctor, he adviced me to do my favourite things to divert my thoughts. Since i am PC game freak, i started playing games whenever such thoughts come to my mind. It doesn't help that much but at least for time being my mind is diverted somewhere else.