PITTSFIELD, Mass. (AP) – For some juvenile offenders, their choice is straight out of Hamlet: to act or not to act.

Shakespeare & Company, a theater company in Lenox, Massachusetts, works with the courts to get youngsters who run afoul of the law sentenced to perform works of Shakespeare onstage as an alternative to community service or juvenile detention.

Juveniles sentenced to Shakespeare read the bard’s works, take on the role of one or more of his characters, come up with ideas for costumes and sets, memorize their lines, rehearse and then act out their roles for an audience of family, friends and court personnel.

The kids almost always hate the idea of performing Shakespeare at first, but by the end of the six-week program, many say they’ve found new friends and a new sense of accomplishment.

“Honestly, you would never catch me doing this stuff if I didn’t have to, but it’s taught me teamwork and to just chill out and listen,” said one 17-year-old boy who will play Macbeth in a March 22 production that will include scenes and monologues from various Shakespeare plays.

Similar Shakespeare programs are offered to inmates in prisons around the country as a way of boosting self-confidence and literacy.

For the past 17 years, Shakespeare in the Courts has been used to sentence youths accused of a variety of lower-level crimes, including larceny, assault and battery and vandalism. In 2007, the program won a national “Coming Up Taller” award from the President’s Committee on the Arts and Humanities.

The probation officers, teachers and others who work in the program hope it will help the teens respect the feelings of others, fulfill a commitment and foster a sense of pride.

“I never really tried acting or theater, so coming in, it was challenging,” said the 17-year-old playing Macbeth, shortly after practicing the famous sword-fighting scene during a recent rehearsal at a Pittsfield church.

The Associated Press is not using the teens’ names because they are minors and their identities are protected by the court.

The program was started by Paul Perachi, a former high school principal who recruited the theater company to work with his students. Years later, after he became a judge, Perachi asked the theater group to develop a Shakespeare program for juvenile offenders.

Since then, Kevin Coleman, a founding member of Shakespeare & Company, has worked with more than 300 teenagers, many who have struggled with poverty and family issues.

“We take baby steps into it, because they’d rather go to jail than be involved in this project,” Coleman said.

“We get them to work together as a group, getting them to talk about themselves, getting them to name feelings. And then, bit by bit, we start with small bits of text, then larger amounts of text, then individual soliloquies and then group scenes.”

During a recent rehearsal, three girls appeared to relish their roles as witches in “Macbeth,” creeping and crouching, then leaping around a small table. “Fair is foul, and foul is fair!” they chanted.

Only a handful of teens have refused to participate or dropped out before finishing the program, Coleman said. Those teens have been sent back to the judge to be resentenced to community service or another alternative program.

Juvenile Court Judge Joan McMenemy said the program stems from a rehabilitative approach to juvenile justice.

“This just broadens their horizons beyond what they could have had if they had been sentenced to pick up trash on the side of the road or other community service options,” McMenemy said.

The program’s success is difficult to measure because the court hears only occasional anecdotal information about what the participants do later in life. But McMenemy said one indicator of success may be the huge smiles on the kids’ faces when they stand on stage after their performance and hear applause from their family, friends and teachers.

“I think it gives them confidence to overcome their fears, get up on stage and knock it out of the park,” she said.