circlecollision expanded to work for n balls rather than just two