Transformed code to make use of Worker threads