All melatonin is not created equal. Seriously consider liposomal melatonin to not only help with sleep but also detox the brain. I carry good brands at www.tiffanysfit4life.com in the store.
If you have bloating, gut inflammation, the gut can't absorb a pill well.
It's a hormone, don't stay on it, cycle off of it at 14 days. If it makes you groggy, you are probably moving toxins, you need to add a binder, or chlorella to your diet, and sweat more to help move the toxins along.
Lastly, sleep disturbances are usually cortisol, this is typically a result of
1. The wrong dinner, and blood sugar drops.
2. The liver is burdened with toxins and disrupting sleep
3. Parasitic activity at night.
Google Dietrich Klinghardt's work at the Sophia Institute for references.
~Doc Brown Bush