fixing up threading

and some indents