 During the eleven years of his slavery in Algiers Cathcart managed by means of good fortune, cleverness, and bribery to improve his circumstances, eventually becoming chief clerk to the Dey.In this position, he acted as a mediator between the Dey and Joseph Donaldson, Jr. agent for Colonel David Humphreys, the U.S. Minister to Portugal, that resulted in the Treaty of Algiers of 1796 and made possible his freedom.Cathcart, for the first several years of his captivity, endured the same terrible living conditions as his fellow slaves.