complete the assignment2 by chenxin