implemented a quadtree to greatly decrease amount of collision detections