refactored killBrick function