missing solution
some improvements