Kenneth MacAskill, the Justice Secretary, calls it the malicious cycle - the depressing process by which the same people keep returning to prison - but it is one that Scotland has seemed unable to break.

The prison population has continued to rise even though a third of offenders are found guilty of a further offence within a year. They are locked up, released and then locked up again. In other words: prison does not work.

We have known this for some time just as we have known change is needed. Report after report from Audit Scotland and former First Minister Henry McLeish among others, has questioned the purpose and impact of prison and called for a refocus to make it more effective and to achieve what must be its primary function: to reduce offending.

Now, at last, the Scottish Prison Service (SPS) has indicated a radical shift in direction. Keeping prisoners in custody, says its chief executive Colin McConnell, will no longer be the sole raison d'etre of the service. Its focus instead will be on helping offenders to change their behaviour.

This is an entirely welcome change, as are the other core reforms proposed for the way the SPS works. According to its new mission statement, the core function of the SPS will extend beyond running orderly prisons to playing a key role in reducing offending. It also says the SPS must work more with community organisations to support prisoners to live positive lives on release (and recognises that the immediate post-release period is critical). It also states that purposeful activity in prison should develop practical life skills.

All of these measures have the potential to reduce reoffending. They will be unpalatable for some - part of the reason this change has taken so long is politicians have been afraid of how a shift from punishment to rehabilitation would go down with the public - but we know the chances of a prisoner reoffending are determined by factors such as educational opportunities in prison, employment, family and the environment to which they return after a spell inside.

A refocused SPS could have an impact in all these areas, particularly by working more closely with organisations on the ground, although community alternatives to prison will also have to be used more effectively and properly resourced. The focus of the entire system should be on preventing offenders going back to prison rather than punishment for the sake of it. This week's change at the heart of the SPS is a significant step towards that aim.