tested neighbor interaction length
added optimized distanceto calculation