 In 1868 he was appointed a Member of the Bombay Legislative Council.In 1868, upon the death of Sir David Brewster, he was appointed Principal of Edinburgh University.From that time till his death, much of his energies were devoted to the well-being of the University.