Better solution for #191

This solution is better than the one I submitted before for #191.  Supports a full object graph via recursion that was missing before.