Fix for windows
Tried to improve the mutli core algorithm