Final commit for submission of exercise 8. Some minor fixes. Comments added.