Implemented solution to problem 1
Implemented solution to problem 2