my solution of assignment 2