got the max grid functions working