Finally, a court ruling that considers the impact on the Luzerne County kids whose lives have been upended.

After stumbling during the initial stages of the upstate cash-for-kids scandal, the Pennsylvania Supreme Court moved to try to restore confidence in the state's juvenile-justice system. In an unprecedented ruling last week, the high court tossed out 6,500 juvenile-court cases tainted by an alleged kickback scheme involving a former Luzerne County judge.

The teens - many of them now young adults - had been duped into going before the judge, Mark A. Ciavarella Jr., without an attorney, for mostly minor offenses. After a perfunctory hearing, many found themselves immediately packed off to detention centers for months at a time.

Federal prosecutors allege that Ciavarella and another former judge, Michael T. Conahan, took $2.6 million in payments from the operators of two private detention facilities where the teens were jailed.

Under a 48-count indictment, Ciavarella and Conahan face years in prison if convicted. (An earlier plea deal was scuttled.) The two former judges will be tried before a jury of their peers. Unlike the teens they allegedly railroaded, the judges will surely have proper legal representation.

State Supreme Court Chief Justice Ronald D. Castille branded the two judges "rogues" and "renegades." In tossing the cases, the high court finally gave the teens the justice they deserved.

For some, it has been a long wait. The teens' appearances before Ciavarella date back as far as 2003, and as recently as 2008.

In early 2008, the Supreme Court rejected efforts by juvenile advocates to look into why so many Luzerne teens were being jailed for minor offenses.

Only after federal prosecutors indicted Ciavarella and Conahan early this year did the Supreme Court go back and order a full review of the teens' cases.

By summer, the Castille court took another important step along with Gov. Rendell and state lawmakers by forming an 11-member commission to investigate the scandal and make reform recommendations.

In its welcome ruling tossing the 6,500 cases, the Supreme Court cited "a travesty of justice." The move was hailed as an "exceptional response" by advocates at the Juvenile Law Center in Philadelphia, whose earlier pleas for the court to intervene were rebuffed.

The high court was clear about the lack of fair and impartial justice in the cases it tossed: "This court simply cannot have confidence that any juvenile matter adjudicated by Ciavarella during this period was tried in a fair and impartial manner."

As a footnote, the court allowed the Luzerne prosecutors to review about 100 cases and request permission to reopen those that involved more serious offenses.

That would be a mistake at this point, both on double-jeopardy grounds and based on the fact that these were juvenile-delinquency cases - not major offenses tried in adult court.

The Supreme Court did the right thing in sweeping away the taint left by the Luzerne judges.

That should be the final word.