adds function and mixin for generating grids