Updated raycasting to use min weight.