Added pipe support. This needs some work, it's not very quick.