added mutex, that made multithreading pointless (it is slower that single)