cleanups, more docs, remove dead code
added Pipe and cout