finished code for quiz 1 in chapter7!