It was the smell of chocolate that hit you first, like a battering ram of melted sweetness to the nose.

The scent of it filled the building, wafting up from giant vats of warm liquid cocoa and caramel.

Before dawn, the oven boys would have done their bit, earning five shillings for a 55-hour week to keep the fires stoked.

It was the Victorian era and the Gray Dunn & Co bakers and biscuit manufacturers were under Royal Warrant from Queen Victoria herself to produce cakes and bread to feed the nation.

The firm's factory was built on Stanley Street in Kinning Park, Glasgow, in 1862 and for the next 139 years the toasty aroma of baking would accompany the creation of some of Scotland's most beloved teatime treats.

There were Blue Ribands, a chocolate biscuit launched in 1936 with a crisp wafer heart covered in a very thin layer of milk chocolate.

Scots could not get enough of them and at their peak more than 2000 came off the production line every minute.

They also produced a similar, non-coated version called Caramel Wafer. Then there were the Breakaways, the Chunky Kit Kats and the Caramacs.

Biscuit by biscuit, the factory rose to become one of Glasgow's most iconic buildings but after years of neglect the city is now bidding it a final yet fond farewell.

Derelict since 2001, the biscuit factory is being demolished to make way for a cash and carry.

The former workplace of thousands of Glaswegians, where many a marriage and friendship was born, the building has been neglected over the past few years and left in a state of dangerous disrepair.

A decade and a half on, it has spent its latter years as a dusty canvas for the city's street artists and a popular location for urban explorers.

Photographer Matthew McAndrew, from MCM Photography, is one of them, after he was able to access the derelict building in 2015.

"I've always been an admirer of urban decay and abandoned buildings and the old biscuit factory never failed to catch my eye whenever I was driving along the M8," says Matt.

"I was hired by a record label to take some promotional portraits of a local electronic producer whose music has dark and apocalyptic feel to it so I thought an abandoned and decayed setting would be ideal, and thankfully he agreed.

"The building was empty and there was no security around, so we wandered in and started exploring."

What he found, was a building stripped right down to to its bones.

"Everything of value had long since been removed, leaving an empty shell of a factory building surrounded by piles of broken bricks and rubble," says Matt.

"It was clear that many people had been in there before us as someone had made a makeshift ladder using some rubble and an old metal security barrier.

"Once I climbed up to the first floor, every exposed wall was covered in graffiti from floor to ceiling."

"The building had a very ominous and eerie feeling to it but still felt structurally sound despite its age," adds Matt.

"In smaller side rooms, thick layers of paint were bubbling and peeling from the walls. Every window was smashed, with shards of glass and empty spray cans littered across the floor.

"It was a truly fascinating place to explore and I'm glad I managed to do so before its demolition."

Cranes have been on site slowly taking apart the old building, ripping out veins of twisted metal and painted brick.

It is a tough job given this was the type of building our ancestors built to last.

Vandals made off with the copper from the windowsills and the lead piping long ago but the bare boned columns of the factory are now also set to disappear after withstanding two world wars and multiple owners.

During the war years, more women were employed in the factory as the men went off to fight.

They made biscuits for the soldiers named "hardtack" because you had to dunk them in water for an hour before you could eat them.

As one worker recalled, in the Our Glasgow book by author Piers Dudgeon:

"Everybody had a different part of the process, and I was at the bit where you solder the lids on.

"We used to put wee notes in, before we soldered the lids on! Oh, aye, love an' kisses on the bottom of the notes!

"And S.W.A.L.K. We'd put in the wee notes so it would cheer them up, opening the tins, having a wee laugh and finding a wee note."

For those preparing the biscuits at the Glasgow factory, Grey's became something of a family.

Sons and daughters followed their parents into the business, some working in the wafer room, others on the Caramac production line.

Romance sometimes arose between the staff at the Breakaways and the Caramel Wafers.

Their 'local' was The Angel bar, at Paisley Road Toll. They ran dances and karaoke nights, and the resulting biscuit babies grew up to be brought to the pantomime at Christmas.

Where their grandparents had once baked hardtack for the soldiers, generations later the grandchildren were producing biscuits in their thousands for supermarket giants Tesco and Marks & Spencer.

Chocolate Gingers needed to be wrapped and boxed, Chunky KitKats too.

Then, in January 2001, the staff were all called into the canteen one morning.

Gray Dunn had gone into receivership.

Redundancy notices were handed out to 86 workers. The remaining 129 stayed on, fighting to save it and hoping for a rescue package.

Despite the prospect of job losses, workers battled to keep contracts and fulfilled orders for Marks & Spencer, Co-op and Tesco.

The company had suffered heavily from bad trading and the loss of a major European customer.

Until 1997, Gray Dunn had been part of European food giant Nestle. However, a management buy out turned Gray Dunn into a privately owned company.

At the time, they were attempting to recover from a disastrous fire in the factory which had destroyed its wafer production line.

In April 1999, the company received a 1.75 million rescue package but it wasn't enough.

It was no longer allowed to trade under the name Blue Riband since its buyout from Nestle.

Under market pressure within the retail biscuit market, worth around 1.7 billion, the amount of products sold under the Gray Dunn name dwindled.

By the end, its own brand products only accounted for about 15% of business.

One of the biggest creditors was former managing director Ray Blakely, who ploughed more than £2m into tackling short-term cash flow problems.

Union bosses called it a "disaster" as tearful workers were sent home in June 2001 from their last shifts.

One said: "The factory has closed - there is nothing more we can say. We are gutted.''

Mike Conroy, regional organiser of the GMB said at the time: "The workforce is devastated. It's a sad day for Glasgow and a personal tragedy for all staff.

"We negotiated to the bitter end but, unfortunately, the factory has now closed.''

Today, Gray, Dunn & Co's colourful biscuit tins are collectors items.

Last month Nestle, which took over possibly Grey Dunn's most famous biscuit - The Blue Ribands - announced that production of the wafer bars was being moved to Poland.

Nearly 300 of their staff face redundancy and it will be the first time in the biscuit's history that it will not be made in Britain.

The staff who once made it here in Scotland, met up six years ago to mark the anniversary of the factory closure, gathering once again at the The Angel.

Many of the memories were fond ones, though they said they could not forget the day everything came to an end.

As one former worker, Brian Leslie, told the Evening Times: "We were devastated, Gray Dunn had been part of our family for so many years.

"I think even my gran worked there years ago. Most days it was a good laugh and we had loads of nights out.

"When it closed it was very cutting. I thought I would be there forever."