solution of #13.