first pass at Q3

recursion, still needs testing