Solution of the assignment
Comments added