Replace everything.

1. Add checking the card type.
2. Deleted unusable comments.
3. Correct lengthNumber.