implemented basic rasterizing function