add check for the quantity of cartacres
algorithm and testing the state paraiba