Move try/except into inner loop
Remove dead code
Better control structure
Change 'tag' to '__tag__'