"getNextCard" function