seperated collision detection and collision resolution