demo using threads