removed unneeded code
more trimming, fixed output
added pipeline population function, added possible solution to flushing problem