From at least 1580,[1] the lieutenant on a ship had been the officer immediately subordinate to the captain. Before the English Restoration, lieutenants were appointed by their captains, and this inevitably led to abuses and to the widespread appointment of men of insufficient qualification. In 1677, Samuel Pepys, while he was Chief Secretary to the Admiralty, introduced the first examination for lieutenant,[2] and thereafter their seniority was dated from the passing of this examination.