Multithreading seems to work (finally!)