Made changes to some threads for better thread manipulation