implemented multithreading
Merge pull request #4 from FabriceCastel/multithread

implemented multithreading