Cleaned up flow, improved raster fcns