Restructure collide.c for merging