finished GetThreads function