added -thread option.  perhaps we want something cleaner