added a test for problem 2
added a problem 2 implementation