first working version of rasterization