Changed how collisions are detected.
I'm not sure if this is any better. Still trying to find the perfect
algorithm.