solutions to the problems from section 1 and 2