Multithreaded kd-tree construction working