Updated and improved collision detection plugin