function finalize() external {
        if (msg.sender != owner) revert();                                         
        if (totalSupply < minCap) revert();                                        
        if (block.number <= fundingEndBlock && totalSupply < maxCap) revert();     

        if (!owner.send(this.balance)) revert();                                   

        balances[owner] += ownerTokens;
        totalSupply += ownerTokens;

        isFinalized = true;                                                     
    }