updated multithreading rep.py