Finishing hw06 problems.