add solution to second problem