As you get close to the threshold when meditating yourself to sleep, your thoughts turn to goop. I've found it much easier to just count my breaths, simply starting over if I lose track. The hardest part is to not forget what you were doing as your mind drifts.