Implement avoid thread

Now 2 threads are running avoid and main.