first solution to p39