implementing raster pattern