Code much more robust to off by one in point cloud lists