solution

assignment2 completed.