grid tiler code