added second example for threads