Modified multithreaded version
After quick fix of multithreaded app