str2cat in mw_util.py so it can be reused