I use melatonin, too. In very small amounts. I take 1/2 a mg. about 30 minutes before bedtime, and the other half at lights out. I take a meager teaspoon of gelatin a little before the first 1/2 mg of melatonin, and most of the time, it works brilliantly.
When I go thru intractable insomnia (usually linked to any amount of emotional stress, which right now can range from the minimal to making a phone call to paying bills or dealing with a mis-delivery from Amazon), I take 1/2 a Unisom (which for me works like a total miracle, whereas nothing else in that medication class does), which generally will knock me out within 35-40 minutes and keep me asleep til I cant ignore the alarm anymore ....
I'm really happier than I can say about your being able to get some decent sleep. Interesting to see how working out will affect that ....