Card creation and sorting