implemented nice Thread class