Meng's solution for week5