Image caption Helena Kennedy QC has authored a BBC programme about women's treatment in the criminal justice system

Baroness Helena Kennedy QC has been an advocate for prison reform since her earliest days at the Bar. She wrote a book on the unequal treatment of women in the justice system which is still used in the training of young lawyers today.

She's now a prominent human rights lawyer and a high-profile Labour peer in the House of Lords.

In a BBC programme, broadcast on Wednesday night, she asks whether it is time for Scotland to stop jailing so many women.

"Twenty five years ago I wrote a book called Eve Was Framed. It was all about women and criminal justice and the ways in which a system that was not designed for women, frequently failed to deliver fair outcomes for them. Crime was all about men and male behaviour; women did not fit.

Image caption Helena Kennedy's seminal book 'Eve Was Framed' was published in the early 1990s

As a young lawyer I had seen it all up close.

When women were the victims of crime, especially rape and domestic violence, they often came up against a hostile court.

They were judged on different standards.

Were they behaving appropriately? How were they dressed? Had they been drinking? Were they flaky? Did they provoke men?

Did they make things up? Were they promiscuous? Were they good wives and mothers? Did they make men hit them?

Was it six of one and half a dozen of the other?

The mythology about women and the stereotyping of what constituted good womanhood blighted the system.

And not just for women at the receiving end of crime but the same underlying attitudes to women disfigured justice for women who appeared as the accused.

The judges, prosecutors and police who were mainly men were not even aware they were doing it.

A lot has changed within our society and within the legal system.

There is far greater awareness of gender bias and how it works in insidious ways. And for that we should be truly glad.

The courts now have many more women sitting as judges and acting as lawyers, which makes a difference to the discourse.

Image caption Helena Kennedy has acted in many of the most prominent cases of the last 30 years including the Brighton Bombing, the Guildford Four appeal and the bombing of the Israeli embassy

Men are generally more alert to the ways in which the reality of women's lives can be very different from that of men.

They are more often the primary carers of children. Their job opportunities can be even more circumscribed. They rarely have money to pay fines. They are more likely to have experienced domestic violence and more likely to have been abused as children.

In the past few months I have revisited the issue of women in prison. BBC Scotland gave me the opportunity to author a programme on the Scottish prison system, which is about to embark on some serious reform.

One of the great scandals is that we have seen a massive increase in the numbers of women going to prison yet no significant change in the seriousness of women's offending.

Women very rarely commit serious crime. It is all low level offending and invariably is as a result of wretched circumstances.

So why are all these women being sent to prison?

Partly it is a consequence of the political Dutch auction that occurs around crime, with parties trying to outdo their opponents on who is dealing more seriously with offenders. This leads to changes in sentencing because judges and sheriffs are not immune to pressure from the media.

Image caption She met a group of women at Cornton Vale, including one who is on remand and others serving time for shoplifting, drugs and fire-raising

But there is also the problem about the absence of real alternatives to prison.

Judges tell you they would like to avoid prison for many women but have no other option.

Many console themselves that at least it will give the women some respite from the pressures that lead to drink and drug abuse and will help them clean up.

Visiting Cornton Vale Prison and sitting with women who had volunteered to take part in the programme was like being catapulted back in time.

It is all still the same. Just more of them - doing time.

Women who have been battered and abused by partners, violated as children, been subjected to cruelty that breaks your heart.

Is it any wonder they have drink and drugs problems or that they self-harm?

Arms were held out - criss-crossed in patterns of scars that are silent screams telling of internal wounds that has never been healed.

And then there are the stories of their children. The pain of separation. Losing your children to the care system. Feeling you have failed so utterly. And I left the prison asking myself what we think we are doing as a society.

But there is hope. I saw it in the small number of alternative projects where women can receive the support they so urgently need. Help with therapy and grief counselling.

Help with acquiring skills. Rehabilitation for addiction problems. Kindness and compassion on offer in abundance. Not a soft option by any means. It is hard confronting your own behaviour.

What is needed is more of these projects but that requires investment. What we have to remember that they are still cheaper than prisons.

Image caption Tomorrow's Women is one of the Glasgow-based alternatives to prison and works with up to 100 women at a time

The good news is that there are reforms afoot and the Scottish government may be leading the world if it works.

Cornton Vale is going to be torn down and a smaller prison for serious offenders built in its place.

Five further small prison units will be created around Scotland so that other women can be located closer to home.

The new units will be much more therapeutic in approach and help prepare women for living well in the community.

The piece that still needs to be championed is a serious reduction in prison sentences altogether.

Image caption The governor of Cornton Vale, Rhona Hotchkiss, will head up the development of the new female prison estate

Why are so many women remanded in custody in Scotland and then when they face the court they never receive a prison sentence at all or are acquitted?

It is as though they are sentenced in advance of trial.

Why prison at all?

What has happened to the probation service?

And how about funding a real spread of alternatives to prison which help women get their lives on an even keel.

Most of these women are themselves victims - victims of unacknowledged crime in many cases.

Certainly victims of a world that gave them few chances. Now Scotland can show the way."

Women Prisoners: Throw Away the Key? will be broadcast on BBC One Scotland on Wednesday 15 June, at 21;30, and for a month afterwards on the BBC iPlayer.