solution of the assignment 2