changed array list to stack in hand