After Taksin's death, General Chakri became the first king of the Chakri dynasty, ruling from 1782 to 1809. His first action as king was to transfer his administrative headquarters across the river from Thonburi to Bangkok. There he set about to build his new palace according ti the pattern at Ayuttaya. He assembled all surviving master craftmen from the old city. The Grand palace they built contained not only the residences of the king and royal family, but also incorporated the government and judicial offices and, most importantly, the Royal Chapel where the revered Emerald Buddha was installed.