in legal cases a judge assigns punishment to the guilty