Fix multi-threadedness
Another try at actually making this multi-threaded