Improve collision detection