refactored collision detection from boundingbox.contains to boundingbox.intersects