Maybe get the max beforehand? It'll be easier to read that way.