Scientists discover what controls waking and going to sleep