Fixed both issue #1 and #2

Fixes issue #1, where the length above 30 characters probably isn't a card, and issue #2, where it loops twice rather than once.