optimized getsubtags() and added comments to taglookup.py