flexible way to change the grid with modulo operator