How I did it was I added all blocks to the blocksCache, and then I went through that to find blocks that matched. I would then add those to the list that would be put into the Pallete. If I didn't make copies of them, then those blocks would dissapear from the original category.