added a function to the card object