MAJOR BUG FIXED: changed mutithreaded logic that leads to 10 times faster computation