assignment 2 solution of 542