function RefreshSoundListUI()
    if not PedroMainUI or not PedroMainUI.soundLabel then return end
	
    -- Clear old buttons
    if PedroMainUI.soundButtons then
        for _, btn in ipairs(PedroMainUI.soundButtons) do
            btn:Hide()
            if btn.removeBtn then
                btn.removeBtn:Hide()
			end
		end
	end
	
    local soundButtons = {}
    PedroMainUI.soundButtons = soundButtons
	
    local soundLabel = PedroMainUI.soundLabel
    local previous = soundLabel
	
    for i, sound in ipairs(PedroSounds) do
        -- Create radio button
        local btn = CreateFrame("CheckButton", nil, PedroMainUI, "UIRadioButtonTemplate")
        btn:SetPoint("TOPLEFT", previous, "BOTTOMLEFT", 0, -4)
        btn.text:SetText(sound.name)
		
        -- Delete button for custom songs
        if i > #BasePedroSounds then
            local removeBtn = CreateFrame("Button", nil, PedroMainUI, "UIPanelButtonTemplate")
            removeBtn:SetSize(60, 18)
            removeBtn:SetPoint("LEFT", btn, "LEFT", 30 + btn.text:GetStringWidth(), 0)
            removeBtn:SetText("Remove")
			
            removeBtn:SetScript("OnClick", function()
                -- Remove from saved list
                for idx, s in ipairs(G.customSongs) do
                    if s.path == sound.path then
                        table.remove(G.customSongs, idx)
                        break
					end
				end
				
                -- Reset selected sound if needed
                if G.selectedSound == sound.path then
                    G.selectedSound = BasePedroSounds[2].path
                    print("Pedro: Selected song was removed. Reverting to default.")
				end
				
                print("Pedro: Removed custom song:", sound.name)
				
                RebuildPedroSounds()
                RefreshSoundListUI()
			end)
			
            btn.removeBtn = removeBtn
		end
		
        -- Set checked state
        if G.selectedSound == sound.path then
            btn:SetChecked(true)
		end
		
        -- Radio button logic
        btn:SetScript("OnClick", function(self)
            if not self:GetChecked() then
                self:SetChecked(true)
                return
			end
			
            for _, other in ipairs(soundButtons) do
                if other ~= self then
                    other:SetChecked(false)
				end
			end
			
            G.selectedSound = sound.path
            print("Pedro: Selected sound " .. sound.name)
		end)
		
        table.insert(soundButtons, btn)
        previous = btn
	end
	
    -- Re-anchor Audio Channel label
    if PedroMainUI.channelLabel then
        local lastButton = PedroMainUI.soundButtons[#PedroMainUI.soundButtons]
        PedroMainUI.channelLabel:ClearAllPoints()
        PedroMainUI.channelLabel:SetPoint("TOPLEFT", lastButton, "BOTTOMLEFT", 0, -10)
	end
	
    ResizePedroMainUI()
end
