Adaptation of part A to fit 2013 lecture. Add exercises solution for part A.