Don't be so quick to jump on the Melatonin train. It has been proven conclusively to inhibit GnRH (the stuff you need to make T) in animals. It controls their breeding seasons, by secreting more, and lowering T, in the long night winter months and then backing off as the days shorten allowing T to go back up.
I used 3 mg a night for over 6 months to sleep and it wrecked my libido. After more than a month I'm still crossing my fingers I'm not permanently suppressed.