Wow man, I'm sorry to hear about your situation. Its good you can atleast come clean with not only your wife, but yourself.

Admitting what you did/are doing wrong is huge. Good luck with all of this, and always remember that god likes to give blessings in disguise