Create Candy algorithm