began thread implementaion