solution of the 3rd part