function buyTicket(uint256 _quantity) payable public registered() buyable() returns(bool) {
        uint256 ethDeposit = msg.value;
        address _sender = msg.sender;
        require(_quantity*getTicketPrice()==ethDeposit,"Not enough eth for current quantity");
        
        
        if (now>=round[currentRound].startRound.add(ONE_DAY)){
            uint256 extraTime = _quantity.mul(30);
            if (round[currentRound].endRoundByClock1.add(extraTime)>now.add(ONE_DAY)){
                round[currentRound].endRoundByClock1 = now.add(ONE_DAY);
            } else {
                round[currentRound].endRoundByClock1 = round[currentRound].endRoundByClock1.add(extraTime);
            }
        }
        
        
        addTicketEthSpend(_sender, ethDeposit);
        
        
        if (round[currentRound].participantTicketAmount[_sender]==0){
            round[currentRound].participant.push(_sender);
        }
        
        if(round[currentRound].is_running_clock2){
            _quantity=_quantity.mul(MULTI_TICKET);
        }
        
        uint256 ticketSlotSumTemp = round[currentRound].ticketSlotSum.add(1);
        round[currentRound].ticketSlotSum = ticketSlotSumTemp;
        round[currentRound].ticketSlot[ticketSlotSumTemp].buyer = _sender;
        round[currentRound].ticketSlot[ticketSlotSumTemp].ticketFrom = round[currentRound].ticketSum+1;
        
        
        uint256 earlyIncomeMark = getEarlyIncomeMark(round[currentRound].ticketSum);
        earlyIncomeMark = earlyIncomeMark.mul(_quantity);
        round[currentRound].earlyIncomeMarkSum = earlyIncomeMark.add(round[currentRound].earlyIncomeMarkSum);
        round[currentRound].earlyIncomeMark[_sender] = earlyIncomeMark.add(round[currentRound].earlyIncomeMark[_sender]);
        
        round[currentRound].ticketSum = round[currentRound].ticketSum.add(_quantity);
        ticketSum = ticketSum.add(_quantity);
        ticketSumByAddress[_sender] = ticketSumByAddress[_sender].add(_quantity);
        round[currentRound].ticketSlot[ticketSlotSumTemp].ticketTo = round[currentRound].ticketSum;
        round[currentRound].participantTicketAmount[_sender] = round[currentRound].participantTicketAmount[_sender].add(_quantity);
        round[currentRound].pSlot[_sender].push(ticketSlotSumTemp);
        emit BuyATicket(_sender, round[currentRound].ticketSlot[ticketSlotSumTemp].ticketFrom, round[currentRound].ticketSlot[ticketSlotSumTemp].ticketTo, now);
            
        
        uint256 earlyIncome=  ethDeposit*EARLY_PERCENT/100;
        citizenContract.pushEarlyIncome.value(earlyIncome)();
        
        
        uint256 revenue =  ethDeposit*REVENUE_PERCENT/100;
        citizenContract.pushTicketRefIncome.value(revenue)(_sender);
        
        
        uint256 devidend =  ethDeposit*DIVIDEND_PERCENT/100;
        DAAContract.pushDividend.value(devidend)();
        
        
        uint256 devTeamPaid = ethDeposit*DEV_PERCENT/100;
        devTeam1.transfer(devTeamPaid);
        
        
        uint256 rewardPaid = ethDeposit*REWARD_PERCENT/100;
        round[currentRound].totalEth = rewardPaid.add(round[currentRound].totalEth);
        
        round[currentRound].totalEthRoundSpend = ethDeposit.add(round[currentRound].totalEthRoundSpend);
        
        
        if (round[currentRound].is_running_clock2==false&&((currentRound==0 && round[currentRound].totalEth>=LIMMIT_CLOCK_2_ETH)||(currentRound>0&&round[currentRound].totalEth>round[currentRound-1].totalEth))){
            round[currentRound].is_running_clock2=true;
            round[currentRound].endRoundByClock2 = now.add(48*ONE_HOUR);
        }
        uint256 tempEndRound = round[currentRound].endRoundByClock2;
        
        if (round[currentRound].endRoundByClock2>round[currentRound].endRoundByClock1||round[currentRound].endRoundByClock2==0){
            tempEndRound = round[currentRound].endRoundByClock1;
        }
        round[currentRound].endRound = tempEndRound;
        
        return true;
    }