Works multithreaded.