add xiu's solution