function mineCard() public payable returns(bool success) {
        require(msg.value == cardPrice);
        require(cardMined < cardNumber);

        int remaining = (int)(cardNumber - cardMined);

        
        int numero = int(keccak256(block.timestamp))%remaining;
        if(numero < 0) {
            numero *= -1;
        }
        uint16 chosenOne = 0;
        while (numero >= 0) {
            numero -= (int)(humanArray[chosenOne].max-humanArray[chosenOne].mined);
            if (numero >= 0) {
                chosenOne += 1;
            }
        }

        
        address newOwner = msg.sender;
        Card memory newCard = Card(chosenOne, newOwner, cardCount[newOwner]);
        cardArray.push(newCard);

        
        indexCard[newOwner][cardCount[newOwner]] = cardMined;
        cardCount[newOwner] += 1;

        
        cardMined += 1;
        humanArray[chosenOne].mined += 1;

        
        if(!owner.send(cardPrice)) {
           revert();
        }

         Mined(newOwner, chosenOne);

        return true;
    }