Added (currently broken) multithreaded version; will fix