Added exercise 1.31b and fixed bug in exercise 1.30