Solutions to problems 5-8