Added collision detection for walls