first pass at script to separate output chunks