added example for multithreading