Solutions to prob5, 6, 7 pushed