added solution for Exercise 3;
tidied-up solution for Exercise 2;
minor tweaks;