The solution to the assignment 2