I know a man who married a woman who already had a child. She went on to have 3 to him and then left him for many other men. She left a troubled elder son with a step father who turned this boy around.
It was not the boys fault his mother was crap and this guy recognised it and just as we would of done centurys ago, he took on the child. A credit to himself.
You could do this also. Think of it as a gift from god.
If you can turn your M around and love your W again , well all the more power to you.