replaced double* distance with new IntersectData class