late 1870s he was in considerable debt and said to be almost bankrupt. However, a rise in the price of tin in 1879 improved his financial position as well as securing the future of Kuala Lumpur. Yap's achievement in the postwar recovery of the mining industry established Kuala Lumpur as the economic centre of the peninsula. As the acknowledged leader of the Chinese community, he was given the powers similar to a Malay ruling chief by the British, except for the right to tax, a restriction he easily evaded. Through his control of the tin market, his ownership of local "farms" (monopolies on the sale of items such as opium and exclusive control of activities such as gambling, prostitution, racketeering and loan sharking), and his diverse business interests, he amassed a considerable personal fortune. In 1879, the first British resident (government advisor) was assigned to Kuala Lumpur, and from that time the power of the Kapitan began to be undermined. None of Yap Ah Loy's successors approached his power and independence of action. In 1884, Yap Ah Loy planned a visit to China, intending to appoint Yap Ah Shak and Chow Yuk to manage his property in his absence. For some reason the plan was never carried out. On 1 September that year, a violent storm struck the Klang Valley, causing widespread damage to property in Kuala Lumpur. The storm blew down 14 houses and a wing of the newly built Police barracks, as well as the barrack's residential area and the flagstaff. Developer of Kuala Lumpur In 1868, as the third Chinese Kapitan of Kuala Lumpur, Yap Ah Loy, emerged as leader. He became responsible for the survival and growth of this town. During the early times, Kuala Lumpur was beset with many problems, including the Selangor Civil War which devastated the town. It was also plagued by diseases and constant fires and floods. Kuala Lumpur was destroyed several times, but each time Yap rebuilt the town. He strove to develop Kuala Lumpur from a small, obscure settlement into a booming mining town. In 1880, the state capital of Selangor was moved from Klang to the more strategically advantageous Kuala Lumpur. In 1881, a flood swept through the town following a fire which engulfed it earlier. These successive problems destroyed the town's structures made of wood and atap (thatching). As a response, Frank Swettenham, the British Resident of Selangor,