A federal judge has sentenced the former coach of a Bensalem youth basketball team to 20 years behind bars. James Hardcastle, 42, used a hidden camera to film underage players while they were in the showers.

Hardcastle pleaded guilty to multiple charges last December, including two counts of attempted production of child pornography. The charges against him stem back to two incidents.

In the summer of 2015, two minors were visiting the former coach’s home. Hardcastle admitted to using a hidden camera in a bathroom in an attempt to video tape them.

Then in June 2016, Hardcastle drove three players to Wildwood, NJ for a basketball tournament. Acting as their coach, he shared a motel room with the boys, who were ages 15, 16, and 16.

The room had no shower curtain. Hardcastle used this fact to insert a USB drive with a hidden camera into a power outlet in the bathroom. He filmed each of the minors taking showers without their knowledge.

“This defendant took advantage of his position of trust as a youth basketball coach to exploit children for his own satisfaction,” U.S. Attorney McSwain said. “This is heinous and reprehensible behavior that deserves the serious punishment that was meted out today. My Office will continue to prioritize the protection of children from such predation.”

As part of his plea deal, Hardcastle also faces 20 years of supervised release on top of his prison sentence. He must also pay $75,000 in fines.