Multithreading

Multithreading was added
End of file is processed correctly now