neighborGem in possibleGems: possibleGems.remove(neighborGem) newGem = random.choice(possibleGems) boardCopy[x][y] = newGem dropSlots[x ].append(newGem) return dropSlots def findMatchingGems(board): gemsToRemove = [] # a list