I can't combine the code because it is setup for recursion.  This will work no matter how many levels you nest data.