added example for spawning a thread