Treating insomnia with medications