Added new demo

Added new demo code. Transfering variables to the thread.