Made collitionDetection work