import java.util.ArrayList;
import java.util.List;

public class Hand {
    private List<Card> cards = new ArrayList<Card>();

    // Constructor
    public Hand(ArrayList<Card> cards) {
        this.cards = cards;
    }

    // Called when player wants to hit
    public void addCard(Card card) {
        cards.add(card);
    }
    
    public ArrayList<Card> getCards() {
        return cards;
    }

    // Returns an array of length 1 or 2 containing possible values of the hand
    public int[] getValues() {
        int val0 = 0; // Hand value assuming first ace is valued at 1
        int val1 = 0; // Hand value assuming first ace is valued at 11
        boolean hasAce = false;
        int[] cardValue;

        // If Ace
        if(cardValue.length == 2) {
            // If Ace already exists in hand, just add 1
            if(hasAce) {
                val0 += cardValue[0]; // 1
                val1 += cardValue[0]; // 1
            }
            else {
                val0 += cardValue[0]; // 1
                val1 += cardValue[1]; // 11
                hasAce = true;
            }
        }

        // Otherwise single-value cards (2-10, J, Q, K)
        else {
            val0 += cardValue[0];
            val1 += cardValue[0];
        }

        if(val0 == val1) {
            return new int[] { val0 };
        }
        else {
            return new int[] {val0, val1};
        }
    }

   public Hand split(Shoe shoe) {
        // Can split only if hand has 2 cards
        if(cards.size() != 2) {
            return null;
        }

        Hand[] newHands = new Hand[2];
        newHands[0] = new Hand(new ArrayList<Card>());
        newHands[1] = new Hand(new ArrayList<Card>());

        newHands[0].addCard(shoe.removeTopCard());
        newHands[1].addCard(shoe.removeTopCard());

        return newHands;
   }
}

@@ -706,16 +706,115 @@
 Value;%0A%0A
+        for(int i=0; i%3Ccards.size(); i++) %7B%0A            cardValue = cards.get(i).getValues();%0A%0A    
         
@@ -827,24 +827,28 @@
 Ace%0A        
+ 
+   
 if(cardValue
@@ -859,24 +859,28 @@
 gth == 2) %7B%0A
+    
             
@@ -924,16 +924,20 @@
 t add 1%0A
+    
         
@@ -961,32 +961,36 @@
                 
+    
 val0 += cardValu
@@ -992,32 +992,36 @@
 dValue%5B0%5D; // 1%0A
+    
                 
@@ -1051,34 +1051,42 @@
 / 1%0A            
+   
+ 
 %7D%0A
+    
             else
@@ -1080,32 +1080,36 @@
          else %7B%0A
+    
                 
@@ -1143,32 +1143,36 @@
                 
+  
+  
 val1 += cardValu
@@ -1199,16 +1199,20 @@
         
+    
 hasAce =
@@ -1222,32 +1222,36 @@
 ue;%0A            
+    
 %7D%0A        %7D%0A%0A   
@@ -1236,35 +1236,43 @@
       %7D%0A        
+ 
-%7D%0A%0A
+   %7D%0A%0A    
         // Other
@@ -1311,16 +1311,20 @@
 , Q, K)%0A
+    
         
@@ -1334,32 +1334,36 @@
 e %7B%0A            
+    
 val0 += cardValu
@@ -1372,32 +1372,36 @@
 0%5D;%0A            
+    
 val1 += cardValu
@@ -1398,32 +1398,46 @@
 = cardValue%5B0%5D;%0A
+            %7D%0A
         %7D%0A%0A     
@@ -1582,16 +1582,100 @@
 %0A    %7D%0A%0A
+    // returns true if hand is soft 17%0A    public boolean softSeventeen() %7B%0A%0A    %7D%0A%0A
    publi

Fix hand.getValues()