When inmates at Maryland’s Eastern Correctional Institution wanted contraband, all they had to do was text. Anything they wanted—drugs, porn, cigarettes—was just a corrupt correctional officer away.

A three-year investigation by the FBI and Maryland’s U.S. Attorney revealed a sweeping Wednesday indictment against 80 correctional officers, inmates, and accomplices allegedly involved in massive smuggling ring in the state’s largest prison. Correctional officers kept many exchanges cash-free, handing out cell phones and asking inmates to purchase contraband using PayPal, the indictment reported. Other officers allegedly extorted inmates in sex-for-drug trades, and forced them to use contraband knives on inmates who threatened to snitch.

People in the know called contraband “donuts,” the indictment charged. The catch-all codeword encompassed cocaine, heroin, marijuana, a long menu of prescription pills, cell phones, pornography, and knives.

And for inmates on the guards’ good side, the racket meant good money.

For a standard $500, correctional officers would smuggle contraband to inmates, who would distribute the products at massive markups. Suboxone strips, a heroin-recovery drug typically retail at $3 each. But inside the prison, inmates allegedly sold the strips for $50 a pop, quickly recovering the $500 they paid the guards.

Inmate Joseph Branch and Correctional Officer Kimberly Rayfield teamed up to run their racket like business partners, the indictment charged. If everything went according to plan, Branch would leave prison with a healthy savings account.

“I keep telling u that if u do ure part im gonna do mine,” Branch texted Rayfield from a contraband phone in November 2015. “I want at least 50,000 leaving this place. I know I can get it. U just gotta remove the leash.”

Tobacco and pornography made steady money, but Branch pushed Rayfield to make a move on the synthetic marijuana market. “I passed out a pack today. So 14000 is owed to us,” Branch texted Rayfield after handing out all but $200 worth of synthetic weed, also called K2. “U can tell me I was right about the flip on the k later. Lol,” he wrote of their profits on the drug.

Branch also asked Rayfield to pick better porn DVDs for their customers. “Some of them movies work, so u can ease them in too,” Branch wrote. “The moreso the freak ones than the regular.”

If they kept up sales at their November rate, they would make “no less than 8,000” on every haul, Branch estimated.

But contraband was hard to move into the medium-security prison, where guards were subject to searches on their way in, and smugglers began to suspect that investigators were onto their contraband ring. To bypass scrutiny, correctional officers allegedly smuggled goods in their underwear, in sanitary napkins, and in more personal places.

“Load up on them joints,” inmate Troy Johnson told an accomplice on a recorded phone call, telling the unnamed man to get “five or six hundred of them” and “put them in his butt.” Inmates will “sell their soul for it,” Johnson promised.

The momentary pain of smuggling drugs in one’s butt might have been soothed by the money flowing through the prison’s network of cell phones. Inmates regularly sent officers PayPal and Western Union deposits worth hundreds or thousands of dollars, using the same phones the officers had smuggled in.

“This is my jail dog,” inmate Zachary Martin texted a supplier after allegedly getting synthetic marijuana smuggled in.

But the smuggling ring wasn’t all fun and direct deposits.

“Defendant COs had sexual relationships with defendant inmates,” the indictment reported. “Defendant COs exchanged sex for contraband. In addition, these sexual relationships cemented the smuggling and trafficking relationships between COs and inmates.”

The indictment does not acknowledge that inmates cannot consent to sex with corrections staff. Under federal law, these incidents are considered sexual abuse.

Business relationships allegedly aligned with gang loyalties. Inmates and corrections officers were often part of the same gangs, and made deliveries accordingly; in the prison’s west compound, a group affiliated with the bloods gang received regular deliveries, and ordered at least one beatdown over a botched delivery on a shipment of synthetic marijuana.

And the beatings increased as correctional officers grew suspicious of an investigation against them. Inmates—the officers didn’t know which—began leaking information on the drug trade that ruled their prison. When officers became suspicious of an inmate, they would allegedly command other inmates to attack the information. The indictment describes two incidents—one linked to a dispute within the bloods gang—in which correctional officers ordered inmates to stab enemies with contraband knives. (The prison is currently facing an unrelated lawsuit by an inmate who says he was stabbed multiple times while an officer failed to act. The officer is not named in the indictment.)

By February 2016, the scheme built on volatile gang alliances was unraveling. Corrections officer Rachelle Hankerson had one major client behind bars, and when he was high on smuggled substances, he couldn’t keep his mouth shut.

“I can’t fuck with someone that’s constantly high or constantly drunk,” a nervous Hankerson told another inmate when they called in a favor on a contraband phone. Too many inmates knew to contact her for drugs, she cautioned the inmate on the recorded call. “You drawing attention to yourself … you constantly approaching me.”

By summer 2016, Hankerson had allegedly ordered one of the knife hits on an inmate who fought with the bloods, who had contracted her for deliveries.

“Don’t let it fuck me up,” Hankerson warned an inmate in a February call when he asked her to deliver contraband. “Cause at the end of the day, I’m gonna get fucked up if shit goes south between y’all.”