improved collisions with walls