the solution for assignment 2