places to threads transition made
removed unnecessary code