add solution to Q3.1