setting up piping logic