cleaning up raster code, and teaching it to issue buffered commands