remove self and clear when calculating distances