Yes, this is very painful. It seems you know the things you have to change to be a better you. Do you see that you didn't show her a lot of love and affection for a very long time? You changed for a while and then went back to your old ways. The changes you make have to be for you, not just to get her back.