second update. not yet finished with multithreaded source