Added region selection capability and factored out add_tag()