Q3

Added the test function for question 3.  Seems to work.