pipe: add documentation and comments