code rearrange and finish credit-card-validator