Exercises for homework 3