solution of #17.