Card stacking using the linked list