Added the first version of the new collision detection routines.