Cleaned up linkCenterpoints kernel and fixed bug in 3D write version