Solved problem 2
Solved problem 3
Solved problem 4