Replaced computer code to new thread version