Added tests. chap 3