Solutions to Chapter 6: Exercise 3, 4, 5 and 6

Change-Id: Ief1d875b11203f97212d2ef26ea438e69718ac8b