Found the solution for the problem.

added the solution for the first problem.