I described the solution to the first problem in full