created a class for creating a thread