Completed exercise 1.7, and added tests to example 1.1.7