- adding the solution to problem2