Creating Collision functions, refactoring