get cards function