Got problem 2 working correctly, and returning correct answer!