fixed pipe madness #1 code