Sorry to hear this. I went through something similar about 18 years ago. Getting sole custody as the father was difficult, but I wouldn't have it any other way. It was worth every penny I ever spent on lawyers.
I hope you and your ex can remain civil and keep the kids first. It will be difficult, but it is what you have to do. Keep your head up and things will get easier as you get over the hurt.
What used to be is gone and what ought to be ought not to be so hard.