finished next section of hw3, problems 7-8