Solution to problem 2
Added problem 3
Problem 4