code and images for exercise 3