zpipes integrated into the code. 1st try. not tested!