added multithreading code that actually works. I'm so proud of myself!