Xianglong's solution to week9