fixed 3D pairs bug, implemented 3D parallelization