My answer for the first three problems.