moved threading to separate branch