adjusted to lint style; fixed cardValue check