Solution to pipes problem.