removed multithreading system. changed to single thread