creating a working thread class