Non-working code, need threading
First working version