renamed some threads
added threading