function unfreezeBoughtTokens(address _owner) public {
        if (frozenTokens[_owner] > 0) {
            uint elapsed = block.timestamp - lastUnfrozenTimestamps[_owner];
            if (elapsed > buyUnfreezePeriodSeconds) {
                uint256 tokensToUnfreeze = boughtTokens[_owner] * percentUnfrozenAfterBuyPerPeriod / 100;
                if (tokensToUnfreeze > frozenTokens[_owner]) {
                    tokensToUnfreeze = frozenTokens[_owner];
                }
                balances[_owner] += tokensToUnfreeze;
                frozenTokens[_owner] -= tokensToUnfreeze;
                lastUnfrozenTimestamps[_owner] = block.timestamp;
            }
        } 
    }