victory.  my recursive method was wrong and too complex so I adapted it.  Referenced a few stack overflow comments