Fix for when there are more or less than 3 cards

When there are 2 cards it throws errors because it never checks if thirdCard is undefined. This change fixes that and allows the cases when you have more than 3 cards.