your function still has to read the table to get the maxvalue right?

nothing is saved with a function