A Rhode Island estate planning lawyer who ran a $46 million scheme preying on the terminally ill—buying bonds and annuities in their names that would pay out upon their deaths—was sentenced today to six years in prison, the Associated Press reports.

U.S. District Judge William E. Smith said the lawyer, John Caramadre, also must perform 3,000 hours of community service helping the elderly and terminally ill after his release from prison. The amount of restitution is still in dispute.

Last May, the judge threw out Caramadre’s request for a new trial—based on what the judge called a “hatchet job” on Caramadre’s former lawyer—and ruled that he should remain jailed until sentencing because he was a flight risk.