Yeah its obsessive compulsive disorder..but dont worry.the most optimistic part of you is that you are writing about your own problems. And dear once you know the problem you can surely come out of it.
Next Steps
The first n formost imp thing you should do is
Remind yourself that i will not repeat the things i have done..consult a psychotherapist.
Health Tips
Relax close your eyes.n simulate the situation n say it yourself that im not doing it agaun n again.control your thoughts..that leads to compulsive behavior.