Remove all the cards.
Match touching pairs of cards of the same value. The cards can be touching horizontally, vertically or diagonally. After cards have been removed, the cards can be re-dealt by tapping the stock. This re-dealing puts the cards back on the stock then deals again without gaps. When the stock is empty, tapping where the stock was will still re-deal the cards removing the gaps.