APPEAL COURT, HIGH COURT OF JUSTICIARY
 HCJAC 12
Lady Clark of Calton
OPINION OF THE COURT
delivered by LORD BRODIE
APPEAL AGAINST CONVICTION
HER MAJESTY’S ADVOCATE
Appellant: J Keenan, (sol adv); Capital Defence Lawyers
Respondent: Edwards QC, AD; Crown Agent
8 February 2017
 On 27 April 2016, at Perth Sheriff Court, the appellant went to trial on an indictment containing two charges of lewd, indecent and libidinous practices and behaviour towards two complainers. The charges were in the following terms:
“(1) between 1 January 2000 and 1 November 2003, both dates inclusive, at [an address in Perth] and [an address in Dunfermline… you [DS] did use lewd, indecent and libidinous practices and behaviour towards [GB]… then aged between 10 and 13 years…and did repeatedly put your hand down his shorts, fondle his genitals, masturbate him until he ejaculated, remove your underwear, cause said [GB] to watch as you masturbated yourself to ejaculation, kiss him on the face and neck and induce him to masturbate you;
(2) on 4 August 2010 or 5 August 2010 at [an address in Leven] you did use lewd, indecent and libidinous practices and behaviour towards [KW]…then aged 12 years…a girl then over the age of 12 years and under the age of 16 years, and did put your hands down her shorts and touch her on her vagina;
Contrary to the Criminal Law (Consolidation) (Scotland) Act 1995, section 6.”
 At the close of the Crown case a submission was made by the defence in terms of section 97 of the Criminal Procedure (Scotland) Act 1995 that the appellant had no case to answer, in that the Crown had failed to corroborate the accounts given by the respective complainers. In response, the prosecutor pointed to the similarities of the conduct which was the subject of charge 1 to that which was the subject of charge 2, and explained that the Crown relied on the doctrine of mutual corroboration associated with the decision in Moorov v HM Advocate 1930 JC 68. The sheriff repelled the section 97 submission. The appellant led no evidence. The jury thereafter convicted him of both charges by a majority.  Having adjourned the diet to obtain a Criminal Justice Social Work Report and a Tay Project Report, on 15 June 2016 the sheriff imposed on the appellant what she intended to be an extended sentence as provided for by section 210A of the 1995 Act, with a custodial term of 38 months and an extension period of 18 months. In her report to this court the sheriff describes the process adopted by her in imposing sentence in the following terms:
“I sentenced the appellant to 26 months’ imprisonment on charge 1 and to 12 months’ imprisonment on charge 2 to run consecutively to the period of imprisonment on charge 1. I imposed an extended sentence within the meaning of section 210A Criminal Procedure (Scotland) Act 1995 comprising the custodial period of 38 months and an extended period of 18 months.”
The sentence is recorded in the minutes of proceedings as follows:
“The Court having considered the report now lodged and heard from Mr McLaughlin for the accused in mitigation of sentence and being satisfied that no other method of disposal was suitable because of the nature of the offence, sentenced the accused to 26 months’ imprisonment from this date on charge 1 and sentenced the accused to 12 months’ imprisonment on charge 2 to run consecutively to the period of imprisonment imposed in respect of charge 1, total imprisonment 38 months from today’s date.
[A paragraph then records a finding of guilt and a sentence in respect of a contempt of court]
The Court imposed upon the said accused an extended sentence of imprisonment within the meaning of section 210A of the Criminal Procedure (Scotland) Act 1995 comprising the custodial period of 38 MONTHS and an extended period of 18 MONTHS to commence from 15 June 2016.”
 The appellant appeals against conviction and sentence. In relation to conviction the appellant submits that the sheriff was wrong to repel the section 97 submission; the conduct to which the respective charges related being insufficiently connected in terms of time, character and circumstance to allow the doctrine of mutual corroboration to apply. As to sentence, it is submitted that the length of the custodial term was excessive having regard to the nature of the conduct, the appellant’s age and his limited record. No point is taken by the appellant in relation to whether the sheriff was entitled to impose an extended sentence or how she went about doing so.
Evidence at trial
 The appellant was introduced to the family of the first complainer in charge 1, GB, in or around 2000 through a family friend. They were all members of, or acquainted through, a church community. The complainer’s family welcomed the appellant into their home and the appellant became a regular visitor. He took a particular interest in the complainer, paying less attention to the complainer’s older brother, who was the more outgoing of the two children. The appellant bought a number of gifts for the complainer, including a hi-fi system and PlayStation games. On occasions the appellant slept over at the complainer’s family home, sleeping in the complainer’s bedroom where there was a spare bed.
 The alleged conduct which was the subject of charge 1 took place in 2002 to 2003 when the complainer was 12 or 13 years old. There were two chapters of evidence: the first related to what was said to have occurred within the complainer’s family home in Perth, and the second related to what was said to have occurred in the appellant’s home in Dunfermline. During the first chapter, the complainer spoke to being in bed, to the appellant being beside him, his right arm behind his head and to the appellant speaking to him about matters of a sexual nature. With his left hand the appellant stroked the complainer’s penis, masturbated him and took his boxers off to ejaculate. The appellant then masturbated himself to ejaculation. Both washed themselves and went to sleep. The complainer thought that this had happened on two or three occasions.
 At the appellant’s home in Dunfermline, the complainer had a bath and was being dried when the appellant invited him to go into the bedroom to lie on the bed. The appellant told the complainer that it was normal to “wank” and he masturbated the complainer to ejaculation. He then put the complainer’s hand on his penis for him to be masturbated to ejaculation. He kissed the complainer on the neck and cheek while he masturbated. Again, this conduct took place on two or three occasions. When the sheriff discusses the evidence at pages 4 and 5 of her report, the kissing takes place in the second chapter of evidence. When the sheriff discusses the evidence at pages 10 and 11, the kissing takes place in the first chapter of evidence.
 The appellant met the older sister of the second complainer in charge 2 in 2010 in homeless accommodation. The complainer’s sister then brought the appellant to her mother’s home where the complainer lived with her mother and other siblings. The appellant became a regular visitor, welcomed by the complainer’s mother who assisted him with paperwork. The appellant brought gifts for the complainer’s siblings, and on one occasion bought the complainer a toiletries set.
 On the day prior to the offence, the complainer and her mother had argued. It was agreed that the appellant would take the complainer on an outing to Edinburgh the following day. That evening the appellant and the complainer travelled by bus to the appellant’s home. Once at the appellant’s home, the appellant and the complainer watched a film together. The complainer changed for bed and went to bed in the appellant’s bedroom. The appellant said that he would sleep on the sofa in the sitting room. Just as the complainer was falling asleep, the appellant came into the bedroom, topless. Without speaking he entered the bed and put his hands down the front of the complainer’s shorts and touched her vagina. The complainer jumped out of bed, left the bedroom and locked herself in the bathroom for the rest of the night. The following morning neither the appellant nor the complainer referred to what had taken place. They travelled to Edinburgh and the appellant offered to buy various presents for the complainer, which she rejected. The complainer telephoned her mother to ask to come home early but her mother was unable to collect her. After the incident the complainer avoided the appellant on the occasions he visited the family home.
Submissions: conviction appeal
 A case and argument had been lodged. It was supplemented by oral submissions by the solicitor advocate appearing on behalf of the appellant. The solicitor advocate submitted that the sheriff had erred in repelling the submission of no case to answer. The alleged offences were insufficiently connected in terms of time, character and circumstances to allow the doctrine of mutual corroboration to apply as between the evidence of the first complainer in relation to charge 1 and the second complainer in relation to charge 2. In advancing that submission, four particular factors were highlighted: (i) the period of time between the two charges was substantial, being at its shortest a period of six years and nine months and at its longest a period of ten years and seven months; (ii) there were only two offences committed against complainers of different sexes; (iii) the nature and the gravity of the conduct in the respective charges was different (the conduct libelled in charge 1 occurred over a significant period of time and on a number of different occasions, involving masturbation of the complainer and masturbation of the appellant whereas the conduct libelled in charge 2 occurred on one occasion and involved one brief incident of touching on the complainer’s vagina); and (iv) there was an absence of any special or extraordinary feature linking the offences.
 In elaborating his submission, the solicitor advocate for the appellant accepted that while a lengthy time gap does not preclude the application of the Moorov doctrine, and there are examples in the authorities of it being applied in respect of longer periods than that in the present appeal, if there is a long gap the factors other than time (character and circumstance) must have extra, in the sense of particularly compelling, force: Tudhope v Hazelton 1985 SLT 209 at 212. In AK v HM Advocate 2012 JC 74 and in AS v HM Advocate 2015 SCCR 62 the periods were admittedly longer than the present case (13 and 18 years respectively) but these cases each had particularly compelling features which drew the relevant incidents of conduct together (the remark “I’ve missed you” in AK and the generational gap in AS). Where the time interval is long, similarities in the relevant conduct spoken to by different witnesses require to be compelling if they are to point to the necessary underlying unity of intent or purpose such as to provide mutual corroboration: H v HM Advocate 2015 SLT 380, 2015 SCCR 242 at para 30, albeit that there is no exceptional feature test in long interval cases: JL v HM Advocate 2016 SCCR 365. The key question was whether the events alleged were so connected in time, place and circumstances as to show that they were examples of a course of conduct. While it is correct to say that there is no maximum interval of time fixed by law beyond which the Moorov doctrine can apply, the longer the gap, the more difficult it will be to accept that evidence of two separate events may be regarded as corroborative of each other. Where there are a limited number of charges separated by long periods of time, great care must be taken before applying Moorov, even where there are similarities in the behaviour alleged. Otherwise, there is a real risk that evidence that, in truth, points only to a general disposition to commit a particular type of offence will, wrongly, be allowed to be used as corroboration: RF v HM Advocate  HCJAC 52. A long lapse of time is, accordingly, “very relevant”: H v HM Advocate at 386. It was accepted that for charges to be withdrawn from the jury on the basis of no case to answer a high test had to be met. The sheriff had to be satisfied that on no possible view of the evidence was there the necessary connection between the different incidents spoken to by the complainers to provide a sufficiency of evidence: Reynolds v HM Advocate 1995 SCCR 504. However, given the long lapse of time between the relevant incidents and the absence of other particularly compelling circumstances, this was a case where the section 97 submission should have been upheld. The sheriff had been wrong not to do so. The appellant’s conviction on the charges consequently constituted a miscarriage of justice and the appeal should be allowed.
 It had not been suggested that the sheriff made an error in her understanding of the law as it relates to mutual corroboration; rather the criticism was focused on her application of the law and in particular her failure to conclude that given the long time-gap between the conduct spoken to by the first complainer and that spoken to by the second complainer, in the absence of any special or extraordinary feature there was simply not enough by way of similarity to allow mutual corroboration to have effect. In the Crown’s submission this was not so; as was apparent from her report, the sheriff had given detailed consideration to the appropriate cases, had applied the law correctly and had come to the correct conclusion. This was a case about grooming. The giving of gifts and the way the appellant had inserted himself into the families of the complainers provided important features of similarity pointing to an underlying unity of purpose. If the time-gap was substantial, as here, one needed to consider whether there were nevertheless compelling similarities but there was no extraordinary feature test: JL v HM Advocate at para 31 (where there is a restatement of the basic principles). That charge 1 related to a number of instances of offending whereas charge 2 related only to one, was no barrier to finding the necessary similarity. Regard had to be had to the circumstance that it was the behaviour of the second complainer that stopped the occurrence of further offending. H v HM Advocate, on which the appellant had relied in submissions, could be distinguished on its facts.
Submissions: sentence appeal
 No issue was taken on behalf of the appellant as to the sheriff’s decision to impose an extended sentence but when the court indicated concern over the competency of the sentence, given the material before the sheriff and the way she appeared to have gone about imposing sentence, the solicitor advocate accepted that the court’s concern was well founded. He was unable to point to anything that suggested that the statutory criterion for the imposition of an extended sentence had been met; certainly there was nothing in the criminal justice social work report. Although the sheriff may have intended to impose one sentence, that is not quite how the court minute read, nor indeed the sheriff’s report.
 What was argued by the solicitor advocate was that while a custodial sentence was accepted as inevitable, a custodial term of 38 months was excessive having regard to the nature of the conduct alleged in each charge, the appellant’s age and his limited (albeit analogous) record. The appellant did have two analogous previous convictions, but they were of some age and were dealt with by way of a fine and a short custodial sentence respectively. The case and argument made reference to the personal circumstances of the appellant as having mitigating effect, but the solicitor advocate expressly disclaimed reliance on these in support of the contention that the sentence imposed by the sheriff had been excessive.
 The advocate depute was invited to comment on the competency of the sentence imposed by the sheriff. She was unable to support it; whatever precisely the sheriff intended, what she did had the look of imposing three sentences.
 The law as to when credible and reliable evidence from one source of the occurrence of one event, can provide corroboration of credible and reliable evidence from another source of the occurrence of another event (and vice versa) is very familiar. We refer to what was said by the Lord Justice-Clerk (Carloway) in giving the opinion of the court in MR v HMA 2013 JC 212, at paragraph , stripped of its accompanying citation of authority:
“What the court is looking for are the conventional similarities in time, place and circumstances in the behaviour proved in terms of the libel such as demonstrate that the individual incidents are component parts of one course of criminal conduct persistently pursued by the accused. Whether these similarities exist will often be a question of fact and degree requiring, in a solemn case, assessment by the jury under proper direction of the trial judge.”
Unremarkably, as it might be thought, in that the court is looking for similarities as among a number of factors, where one of the relevant factors is weak or absent, if the court is nevertheless to conclude that, overall, there are sufficient similarities, then the other factors will have to be the stronger (or have extra force or be more compelling): Tudhope v Hazelton at 212. That was the essence of the submission on behalf of the appellant: here there was a significant time-gap as between the relevant incidents, that meant that if the sheriff was to be satisfied that nevertheless the incidents constituted one course of conduct, the similarities in place and circumstances had to be very strong or particularly compelling, whereas in the present case they were not.
 The other side of the coin of the point made in Tudhope v Hazelton is what was said by the Lord Justice-Clerk (Carloway) in AS v HM Advocate at paragraph : “The more similar the conduct is in terms of character, the less important time gap may be. ” Bearing in mind that when considering a submission of no case to answer the Crown case must be taken at its highest, we would see that consideration to be apposite in the present case. Contrary to what was submitted on behalf of the appellant, we find there to be strongly compelling similarities in the circumstances of what was spoken to by the respective complainers, given the context provided by the whole evidence in the case. The two complainers were of a similar age, despite being of different sexes. The appellant gained access to both complainers through nurturing the friendship and trust of their respective parents. This was achieved through regular visits, the provision of gifts to the complainer in charge 1 and to the complainer in charge 2 and her siblings. The conduct was perpetrated when the children were entrusted to the appellant’s care and the appellant behaved as he did when he was in a position of trust. The behaviour occurred at night-time when the children were in night attire and in a bedroom. While there was a disparity in terms of the conduct, the conduct in charge 2 began in the same way as the conduct in charge 1 until it was interrupted by the complainer removing herself from the situation. In other words, the appellant’s conduct was the same in each case, in so far as he was able so to behave. What might be thought to have introduced a difference in outcome was the conduct of the second complainer. Moreover, as the solicitor advocate for the appellant accepted, the conduct of the appellant prior to any of the assaults spoken to by the complainers fell readily into the recognisable pattern of behaviour often described as “grooming”. In our opinion, that points strongly to the appellant’s conduct being not only planned but also systematic, in other words being a course of criminal conduct in which the particular assaults are but incidents. We would further observe that while the minimum time-gap of six years and nine months is undoubtedly a long period of time, in evaluating the significance of that, regard has to be had to the nature of the appellant’s conduct as disclosed by the evidence. What can be described as “grooming” is, or may be, a lengthy process. The appellant succeeded in gaining the trust of the complainers’ respective families to what seems a remarkable extent. That, it might be thought, must have taken some time. The points of similarity and the notion of grooming provide the basis for our conclusion that there was sufficient to demonstrate the requisite underlying unity of intent and therefore to allow the application of mutual corroboration. The sheriff was fully entitled to decide on the submission of no case to answer as she did and therefore the appeal in so far as it relates to conviction must be refused
 The only ground of appeal in relation to sentence and therefore the only matter in respect of which leave has been granted is that a 38-month custodial term (made up of consecutive sentences of 26 and 12 months respectively) was excessive. The appellant’s case and argument suggested that the personal circumstances of the appellant would be founded on as providing mitigation but that was expressly disavowed in the course of submissions. The only argument that was presented on behalf of the appellant was that the nature of his offending and the extent of his record of previous convictions did not justify the length of sentence imposed. We shall address that contention but, although the point is not taken by the appellant, as this court must be satisfied of the competency of any sentence coming before it, we shall also consider how the sheriff went about deciding upon and then delivering what she described in her report as “an extended sentence within the meaning of section 210A Criminal Procedure (Scotland) Act 1995”.
 In her report the sheriff explains that in determining sentence she had had regard to the circumstances of the offences, the appellant’s previous convictions (two in number: one in 1986 for indecent assault which led to a fine of £60, and one in 1995 for lewd and libidinous practices which led to 6 months imprisonment) and his personal circumstances. She had been assisted by the terms of the Criminal Justice Social Work Report (the “CJSWR”). The CJSWR noted that the appellant’s position was that the charges had been fabricated and he accepted no responsibility for them. The author, on the other hand, expressed the view that the appellant’s befriending of the complainers’ families would suggest a deliberate attempt to gain trust and create opportunities to have access to children. Given the appellant’s continuing denial, he was assessed as being unsuitable for the Moving Forward Making Changes group work programme. Should a period of imprisonment be imposed, the CJSWR suggested that a period of post-release supervision would be required to address the appellant’s needs and to allow for an exploration of the appellant taking responsibility. On the basis of this material the sheriff concluded that there was no alternative to a custodial sentence. She considered that given that the CJSWR had identified a need for intervention, the vehicle of an extended sentence would allow for supervision and the opportunity for the appellant to address his offending behaviour further once in a community setting. She was aware that her sentencing powers did not entitle her to impose a sentence of imprisonment for a term exceeding three years in respect of charge 1 (the period of the libel in that charge was prior to the commencement of section 13 (1) of the Crime and Punishment (Scotland) Act 1997 which amended section 3 (3) of the Criminal Procedure (Scotland) Act 1995 and increased the term of imprisonment that the sheriff could impose from three to five years).
 It was accepted on behalf of the appellant that the sheriff had been right to conclude that there was no alternative to imposing a custodial sentence or sentences. We agree. It was nevertheless argued that to impose sentences of twenty-six months and twelve months to be served consecutively was excessive. We disagree. These were contact offences against children in relation to whom the appellant was in a position of trust. Charge 1 was particularly serious, relating as it did to significantly abusive conduct on a number of occasions. While in order to convict, the jury had to be satisfied that what was alleged in the respective charges formed parts of one course of conduct, that did not have the result that the sheriff was obliged to impose a cumulo sentence or to order that separate sentences imposed in respect of each charge be served concurrently: M v HM Advocate  HCJAC 74. Indeed, without expressing any opinion on the matter, we can see why the sheriff might choose not to impose a cumulo sentence in respect of the two charges where one charge related to a period in respect of which her powers were restricted to imposing a custodial term of three years, while the other related to a period in respect of which she could impose a term of up to five years. Accordingly, thus far we would not criticise the sheriff’s decision making. However, as it would appear to us, she got into difficulty when she came to consider an extended sentence.
 We remind ourselves of the relevant statutory provisions. Section 210A of the Criminal Procedure (Scotland) Act provides, inter alia, as follows:
“Section 210AExtended sentences for sex and violent offenders.
(1) Where a person is convicted on indictment of a sexual or violent offence, the court may, if it—
(a) intends, in relation to—
(i) a sexual offence, to pass a determinate sentence of imprisonment; ...
(b) considers that the period (if any) for which the offender would, apart from this section, be subject to a licence would not be adequate for the purpose of protecting the public from serious harm from the offender,
pass an extended sentence on the offender.
(2) An extended sentence is a sentence of imprisonment which is the aggregate of—
(a) the term of imprisonment (“ the custodial term ”) which the court would have passed on the offender otherwise than by virtue of this section; and
(b) a further period (“ the extension period ”) for which the offender is to be subject to a licence and which is, subject to the provisions of this section, of such length as the court considers necessary for the purpose mentioned in subsection (1)(b) above.
(4) A court shall, before passing an extended sentence, consider a report by a relevant officer of a local authority about the offender and his circumstances and, if the court thinks it necessary, hear that officer.
Thus, before a sex offender can competently be sentenced to an extended sentence, three criteria must be met: first, the offender must be convicted on indictment of a sexual offence, as that is defined in section 210A (10); second, the court must intend to pass a determinate sentence; and third, the court must consider that the period (if any) for which the offender would, apart from this section, be subject to a licence would not be adequate for the purpose of protecting the public from serious harm from the offender. As was recently emphasised by the Lord Justice General giving the opinion of the court in Wood, Tennant and McLean v HM Advocate  HCJAC 2 at para , “serious harm” means just that. An extended sentence has a considerable penal effect, given the power to revoke the licence and recall the offender to prison (cf Robertson v HM Advocate 2004 JC 155 at para ). Its purpose is to allow the court to make provision for public protection where that is necessary while not imposing a custodial sentence, which from other perspectives, might be disproportionate. Accordingly, before it can impose an extended sentence, the court must have formed the view that when the offender comes to be released from the determinate sentence which it is minded to pass, he will still present a risk of serious harm to the public and in forming that view the court must have first considered a report by a relevant officer of a local authority about the offender and his circumstances, as is provided for by section 210A (4). We do not suggest that the court will be bound by any opinion expressed by the relevant officer but the Act requires his report to be considered and any rational decision on risk of serious harm must take into account what appears in the report.
 There is nothing in the sheriff’s report in the present case to suggest that she had regard to the criterion of risk of serious harm. Turning to the CJSWR, the following passages would appear to be pertinent:
Due to Mr [S’s] denial of the offences, it is difficult to assess his attitudes towards his actions or indeed his readiness to address his behaviour and decision making. Therefore I am not able to fully assess any potential risk of recidivism at this stage, but these offences, alongside historically analogous behaviour would suggest that he has the potential to reoffend in a similar manner.
These offences are relatively historical and whilst his behaviour would demonstrate the potential to cause harm, it would appear that the risk of imminence is reduced.
Suitability for community disposal/public protection issues
Mr [S] is assessed as suitable for a community-based disposal
Post Release Supervision
Should the court decide that a community-based disposal is not a viable option in this case, a period of post-release supervision would be sought in order to allow for the necessary supervision to be undertaken.
Mr S has demonstrated through his offending behaviour a sexual interest in male and female children. As a consequence and during the period of supervision Mr [S’s] access to and contact with children requires to be closely monitored and managed in order to reduce the risk of further offending and serious risk of harm.”
Again, while we note what is said about the need for monitoring and management in order to reduce a serious risk of harm, there is nothing here about risk of serious harm. A community-based disposal is put forward as a possibility but if that is not considered viable then the focus is on the need for risk management through post-release supervision. As we have already indicated when summarising her report, that certainly would appear to be the way in which the CJSWR was interpreted by the sheriff. As she put it: “While the available reports identified a need for intervention, the vehicle of an extended sentence allowed for supervision and the opportunity for the appellant to address his offending behaviour once in a community setting. As appears from the terms of section 210A, that is not the purpose of or a justification for the imposition of an extended sentence. Neither would it be competent to impose a supervised release order in terms of section 209 of the 1995 Act in the event of conviction for a sexual offence, but the release on licence of short term prisoners convicted of a sexual offence is governed by section 1AA of the Prisoners and Criminal Proceedings (Scotland) Act 1993.
 As we do not see the requisite criteria to have been met, the sheriff could not competently impose an extended sentence. However, the way the sheriff went about imposing what she intended as an extended sentence also calls for comment.
An extended sentence is “a sentence of imprisonment”, comprising a custodial term and an extension period. It is not a sentence which is added on to a custodial sentence, nor is it an additional period of time during which the accused will be subject to licence tagged on to the end of the custodial sentence imposed: O’Hare v HM Advocate 2002 SLT 925. The custodial term is “the term of imprisonment which the court would have passed on the offender otherwise than by virtue of [section 210A]”, that being “a determinate sentence of imprisonment” “in relation to - ...a sexual offence.” Now, the terms of the section may allow an extended sentence to be imposed as a cumulo sentence in respect of a number of charges, but the section does not envisage the imposition of a number of separate determinate sentences of imprisonment which are then added together to make up the custodial term of an extended sentence, to which an extension period is then attached (cf Crawford v HM Advocate 2015 SCCR 345 and GR v HM Advocate  HCJAC 94).
 We do not consider that the sheriff had proper regard to these considerations when she purported to impose an extended sentence. As is apparent both from the minute of proceedings and her report, the sheriff began by imposing a sentence of 26 months’ imprisonment in respect of charge 1. She then imposed a sentence of 12 months’ imprisonment in respect of charge 2. She ordered the sentence in respect charge 1 to be served from the date of imposition of the sentence (15 June 2016). She ordered the sentence in respect charge 2 to be served consecutively to the sentence in respect of charge 1. Then, having made a finding of contempt of court and imposing a sentence in respect of that (matters with which we are not concerned) she imposed “upon the said accused an extended sentence of imprisonment within the meaning of section 210A Criminal Procedure (Scotland) Act 1995 comprising the custodial period of 38 months and an extended period of 18 months to commence from 15 June 2016”. It is difficult to avoid the conclusion that this was a third sentence being imposed by the sheriff (or a fourth if the sentence for contempt is included), albeit that the custodial term (referred to in the minute as “the custodial period”) has been arrived at by adding together the respective terms already imposed in respect of charges 1 and 2. Whether or not this is what the sheriff intended, what has been minuted is not an extended sentence, properly understood.
 We shall quash the sentences imposed by the sheriff. We nevertheless propose to respect her decisions as to the periods of custody appropriate to the respective charges. Accordingly, in place of what we have quashed we shall sentence the appellant to 26 months imprisonment from 15 June 2016 in respect of charge 1, and to 12 months imprisonment in respect of charge 2. We shall order the sentence in respect of charge 2 to be served consecutively to the period of imprisonment imposed in respect of charge 1.