card logic done