You're in the right direction!
I provide a similar example here, where you can also download an app to see how I do it using a listView to add remove items.
You are correct that you will need to use a variable to manage the add/remove buttons.
Let me know if you need more help implementing it.