first implementation of rasterization