The surprising factor that affects how well you sleep