function to get cards