added Exercise 5;
minor improvement in compactness/succinctness;
added Exercise 6;
tweaked the code for more elegance;