Commit 15

Worked out logic for second part of problem 2