Turns out, the art of getting a good night’s sleep is surprisingly complicated