function doPurchase(address _owner) private onlyAfter(startTime) onlyBefore(endTime) {
        
        assert(crowdsaleFinished == false);

        if (collected.add(msg.value) > hardCap) revert();

        if (!softCapReached && collected < softCap && collected.add(msg.value) >= softCap) {
            softCapReached = true;
            SoftCapReached(softCap);
        }

        uint tokens = msg.value * price;
        if (token.balanceOf(msg.sender) + tokens > purchaseLimit) revert();

        if (token.balanceOf(msg.sender) == 0) investorCount++;
      
        collected = collected.add(msg.value);

        token.transfer(msg.sender, tokens);

        weiRaised = weiRaised.add(msg.value);
        tokensSold = tokensSold.add(tokens);

        NewContribution(_owner, tokens, msg.value);

        if (collected == hardCap) {
            GoalReached(hardCap);
        }
    }