Living with a roommate or multiple roommates can be wonderful or challenging depending on how you get along with the roommate(s). Of all the annoying things that roommates could do it’s probably waking you up in the middle of the night when you’re trying to sleep.

This is the true story of three nurses who share an apartment. One of the nurses shared the story on Reddit to explain how he had trained one of his roommates not to wake him up at night. Is it sinister or genius? You decide.

Reddit user rustybathtub titled his post “How to Train Your Roommate” and shared that he used “Pavlovian Conditioning to train my formerly obnoxious roommate to behave like a responsible adult.”

The backstory is that the three roommates live in an apartment where they each have their own room and there is a shared common area. If someone is talking loudly in the common area, you can hear everything they’re saying in all of the bedrooms, but if someone is talking loudly in one of the bedrooms, you can’t hear what they’re saying in the other rooms. Basically, if you’re being respectful, you wouldn’t talk loudly in the common area when your roommates are sleeping.

Rustybathtub went on to explain, “And since we are nurses, we have to work in shifts, me and the second roommate work on 12-hour day shifts (8 am to 8 pm) while the third obnoxious one works on 12-hour night shifts (8 pm to 8 am). So, the third roommate tends to be awake at night. We get to sleep soundly when our third roommate has worked, but every time he doesn’t have to go to work the two of us tend to be disturbed by his late-night blabbering on his phone.”

They asked the obnoxious roommate to talk on the phone in his room at night, which he did for awhile, but eventually he went back to talking on the phone in the common area.

That’s when rustybathtub had a lightbulb moment. “Our Hallelujah came from an episode of The Office that I had just watched wherein Jim trained Dwight to crave a breath mint every time he restarted his computer. A lightbulb suddenly switched on in my head to use our WIFI, to train my noisy roommate. Nobody else knew that I had admin privileges, I just happened to be there when the guys installed it and they gave me the key. I realized that I had access to our WIFI network wirelessly on my phone and could turn it on and off on a whim like a god.”

Every time the obnoxious roommate talked on the phone at night, rustybathtub turned off the WIFI. When the obnoxious roommate when in his room, he turend the WIFI back on. Eventually, the roommate thought something was wrong with his phone and that the WIFI didn’t work on his phone in the common area for some reason. Although “the training took months and countless late nights,” it worked. Rustybathtub shared, “I was grinning like the devil the whole time.”