added support for both simple and multiple pipes