created a simple inteaction of threads
added some flags