change grid to use some vars