finally, got a better pipe implementation