Added multithreading
Modified loader to work in mulithreading