implement cardinit logic