chap 7 exercises: added tests