Added 1-3 of exercise 4