Thank you for your honesty and willingness to confront these very difficult feelings. It takes a great deal of courage and bravery to look at yourself and figure out what is going on. The fact that the urge scared you so much is a very good sign because it means that the part of you that is trying to control these urges is letting you know it needs some help.
I’m not certain how the family history may be influencing all of this, but it may be — and I would encourage you to get some testing by a clinical psychologist or an evaluation by a psychiatrist to help get to the bottom of it. The fact that these thoughts are unwanted and you are trying to manage them is important to talk about with a professional. This isn’t being weak — in fact it is one of the bravest things anyone can do.
In the meantime you may want to use one of our forums to talk more about this — and see how others have been dealing with similar feelings.