import _thread module
put everything in functions