When Pawel Rey and Lech Jeziorny embarked on a complex management buy-out of a failing slaughterhouse not far from the historic centre of Krakow, they knew they were taking a business risk - what they didn't expect was that they would end up jailed and bankrupted for their efforts.
The project came to the attention of the local prosecutor's office, and the entrepreneurs, along with some partners, were charged with running a criminal enterprise and attempting to steal enormous sums from the company they were trying to buy. They ended up spending nine months in jail while prosecutors hunted for evidence against them. Finally, under prodding from the court system, prosecutors dropped all charges against them at the end of last year - leaving the two men to try to rebuild their businesses and their reputations.
"We were acting openly and legally. We didn't try to hide anything," says Mr Rey. "We were aware of business risks but we didn't recognise how things really work in Poland."
The pair's experience with the law is part of a wider problem for Polish businesses, a number of which have been driven into bankruptcy by tax and law enforcement officials making incorrect decisions based on badly drafted and frequently changing regulations.
"Often before the interpretation of a law has been fixed, it is changed again," says Jeremi Mordasewicz, a labour market expert with Lewiatan, Poland's employers federation. "The real source of the problem in these types of cases is a lack of trust on the part of bureaucrats, who treat business with suspicion."
The government has promised to make radical changes - Donald Tusk, prime minister, has pledged to take a "machete" to red tape. Although progress has been slow, the government, which has been in power since 2007, has made life slightly easier for business by tweaking the rules about value added tax, making it simpler to register a company, and decreasing the frequency of companies in dispute with officials having their accounts frozen.
For some, however, the reforms are not fast enough. Roman Kluska is a computer entrepreneur who became the poster boy for the need to reform relations between Polish business and officialdom when he was arrested in 2000 on allegations of tax evasion before being cleared of all charges in 2003. Last year he told the Rzeczpospolita newspaper: "We say that we are a normal European country, but the facts show that we are still rooted in real socialism."
Mr Kluska was commenting on the 1,220 zlotys ($429, €315, £285) granted to US businessman Mitch Nocula after his machine tools company was driven out of business when inspectors incorrectly accused him of using illegal software.
When Mr Rey and Mr Jeziorny came up with their business idea, they were not figuring on becoming examples of bureaucratic wrongdoing - they were hoping to save a struggling meat plant, renovate part of their home city and make a bit of money in the process. Both had served time in prison in the 1980s for their anti-communist agitation as members of the Solidarity labour union, and both had shown that they had a knack for making money during the tail end of communist rule and the early years of Poland's turbulent return to market economics after 1989.
Mr Rey began selling brass candleholders while still in university, then ran an electronics shop in Krakow in the early 1980s. After the end of communism, both his business experience and the funds he had gathered from his earlier ventures made him stand out in a country where few people had an entrepreneurial background. He started a leasing business, then a technology company, which is still listed on the Warsaw Stock Exchange, before his friend Mr Jeziorny persuaded him to get involved in managing a failing state-owned company in Krakow.
Amid the tangled mess of the post-communist era, they spotted an opportunity that led them to undertake a series of management buy-outs in 1997 and 1999, leaving them owning a large plot of land with a decrepit milk factory on the outskirts of Krakow, and a meat plant just 1.5km from the mediaeval heart of the city.
Mr Rey recalls the stench and noise of panicked pigs as they were driven down the street in front of the management building on their way to slaughter. "This place was obviously completely unsuited to any EU regulations. The only answer was to move it to the outskirts of the city," says Mr Jeziorny.
Their idea was to rezone the land round the meat plant and sell it to a developer, while taking an additional loan and building a meat-packing plant on their land on the edge of the city. As part of the transaction, the proceeds from the first sale went to companies controlled by the two owners, while the cost of building the factory was covered by a loan - something that appeared suspicious to the prosecutor's office.
By 2003 the partners had sold the old plant to GTC, one of Poland's most successful developers, which has since built a modern shopping mall on the site incorporating the old brick slaughterhouse buildings. They had also succeeded in building and opening a meat company and plant called Krakmeat. The hunt was on for an investor who would take over the new processing plant, allowing the partners at least a partial exit from their venture.
That was when the prosecutors swooped. Both men and their partners were arrested as part of a wider investigation into business corruption surrounding the privatisation of former state assets. They were charged with heading a criminal conspiracy, money laundering and working to harm their companies to the tune of 20m zlotys. A parallel tax investigation fined them more than 4m zlotys.
"MBOs are a standard business practice, even if communist-era bureaucrats never heard of them," complains Mr Jeziorny.
They were packed off to jail, while prosecutors began to look for evidence to make their charges stick.
"I remember sitting in the police station looking at Pawel's mobile phone, which had been left on a bench," says Mr Jeziorny. "Every few minutes a call would come in from the investor ready to complete the transaction for the meat plant, but we couldn't pick up. What would we say to him?"
Mr Rey adds: "After the arrests, the potential investor fled, of course."
Polish law permits long preventative detentions, sometimes dragging on for years - something that has been condemned by human rights groups. The Krakmeat plant, where 300 people worked, had to be sold to repay debts and the company was soon bankrupt.
After their release from jail, the investigation continued in spite of vigorous attempts by the two to clear their names. Finally, a court ruling in September 2009 gave prosecutors until the end of that year to file charges or drop the case. In his ruling, the judge wrote: "The reason for the long investigation is the improper practice of first presenting accusations and then trying to verify them . . . The procedure should be reversed."
On the last day of the year, the prosecutor's office released a 96-page report clearing the men of all charges. "Because no one wanted to invest in the meat plant, taking the economic risk was justified," said the report. When contacted by the Financial Times, the prosecutor's office declined to comment further.
That is little consolation to Mr Rey and Mr Jeziorny, whose appeal against their tax fine is working its way through the courts.
"We want this event to change something in this country, so that bureaucrats are more careful and more responsible for their actions," says Mr Rey. "How long can we live in a country where this sort of thing happens? Poland is beating itself with its own fist."