almost finished chap 2 section 3: