updated to cards.length