Change 'filename' to 'fileprefix' to be clearer about what is required; updated main script accordingly.
Add extra print to show what is going on during tagging.