he became an msp in the first elections to the scottish parliament in 1999. following the coalition agreement between the scottish liberal democrats and labour in the scottish parliament, he became deputy minister for enterprise and lifelong learning. later in the same parliamentary term he became deputy minister for education, europe and external affairs, and then for education and young people. following the 2003 scottish parliament election, he joined the scottish executive cabinet as minister for transport. in 2005, following the resignation of his predecessor jim wallace, he was elected leader of the party and also became deputy first minister and minister for enterprise and lifelong learning. he led his party into the 2007 election, where they won 16 seats (down one on 2003). he resigned as party leader on 2 july 2008, triggering a leadership election. in 2011 he joined the house of lords. he became a patron of the aberdeen law project in 2011.