part code for quiz 3 in chapter7!