That tutorial is just for a very basic inventory where item sprites are not differentiated. What you're describing probably needs an array where the item is in one row and the amount of them is in the next row and you grab the data. That isn't a great tutorial because it doesn't really help you make a complex inventory, you'd have to start again. It only really covers the drag and drop functionality of placing items into slots, not storing different types of items, amounts of items and checking for the same item. I would look at arrays!