added -mode and -tagexpr options