The new sultan, Selim III, 1789–1807, was young, idealistic and a decided Francophile. He ascended to the throne at possibly the most critical moment in the entire history of the dynasty. Selim III is often characterized as indecisive and incompetent. In reality his agenda was very ambitious, but he lacked the financial resources to implement his reforms effectively. Selim III’s immediate object was to secure the continuation of the dynasty, as he struggled throughout the Napoleonic period to maintain the territorial integrity and legal authority of the Ottoman Empire. His successor Mahmud II inherited Selim III’s partial reforms, which had set the stage for restructuring the military and the elite system of the empire. Machinery imported from Britain and France, coupled with French expertise and master gunners, continued the modernisation begun under Mustafa III. Observers of the period noted that Selim III had ordered the manufacture of the small-calibre cannon, which became a standard component of the Ottoman arsenal.