trying to work through dedup issues with recursive function call