Improved collision and range detection