changes to make the pipeline produce output dynamically; todos added as comments