He then spent a short time in London, studying under John Abernethy and Sir William Lawrence, and in Paris, where he learnt analytical chemistry from Pierre Robiquet and toxicology from Mathieu Orfila. In 1822 he returned to Edinburgh as professor of medical jurisprudence, and set to work to organise the study of his subject on a sound basis. On poisons in particular he speedily became a high authority; his well-known treatise on them was published in 1829, and in the course of his inquiries he did not hesitate to try such daring experiments on himself as taking large doses of Calabar bean (Physostigmine). In 1827, he was appointed physician-in-ordinary to the Royal Infirmary of Edinburgh, a position he held until 1832. His attainments in medical jurisprudence and toxicology procured him the appointment, in 1829, of medical officer to the crown in Scotland. From that time until 1866 he was called as a witness in many celebrated criminal cases, including the Burke and Hare murders.