 He attended the Leachkin Primary School, Jedburgh Grammar School and Loretto School, Musselburgh, before studying medicine at the University of Edinburgh.As an undergraduate he graduated with a first class honours degree in pharmacology and was President of Edinburgh University Students' Association.After graduation, he held a number of junior medical posts in Edinburgh.