You should try eating a banana too!
Contains melatonin which helps you stay asleep.
Also if you sleep with lights on, or daylight coming through your curtains your body won't release it's natural melatonin.
A couple of hours before you want to sleep you should dim the lights and that will help you release melatonin which will make you feel sleepy.
The ambien should help you get into a routine, but I'd try stay away from it for long term use.