One role of the criminal courts is to punish. This means that after deciding if someone is guilty, the judge must decide how to best punish that person. They consider various factors when making this decision, like previous convictions. For example, John Leatham was sentenced to jail for life after the murder of school girl Paige Doherty.