Code to remove small parts