solution of #16.