Music playlist queue script

So I’m trying to make a feature where you can make your own playlist for a couple of robux (19 robux). But I’m a bit confused on how to do this. Here’s my script (local).

local MusicQueue = script.MusicQueue
local IDText = script.Parent.IDText
local MusicList = script.Parent.MusicList
local MarketplaceService = game:GetService("MarketplaceService")
local Music = {}
local CloneQueue = 0

IDText.FocusLost:Connect(function(enterPressed)
	if enterPressed == true then
		CloneQueue += 1
		local ID = IDText.Text
		local Clone = MusicQueue:Clone()
		local Name = nil
		Clone.AssignedCloneValue.Value = CloneQueue
		if not (MarketplaceService:GetProductInfo(ID).Name) then
			return
		else
			Name = MarketplaceService:GetProductInfo(ID).Name
		end
		
		Clone.Name = CloneQueue
		table.insert(Music, Clone)
		Clone.MusicName.Text = Name
		Clone.Parent = MusicList.UIListHandle
		print(Music)
		Clone.RemoveButton.MouseButton1Click:Connect(function()
			local AssignedCloneQueue = Clone.AssignedCloneValue
			Clone:Destroy()
			table.remove(Music,AssignedCloneQueue.Value)
			CloneQueue -= 1
			print(Music)
		end)
	end
end)


What I would do is make a table for the music queue like you did, but handle the songs with table indexes, so when you add a song to the table, it gets stored at the last index of the table, so now you have a sorted playlist, and when you want to remove a song, you just remove that element from the table, and move the rest up, or just skip the removed song index and just continue from the next index.