fix bugs in recursion.  get easy unit tests working