Implemented a Thread class