Adding correct collision detection.