You seem to be calculating this max_norm and then immediately throwing it away