first pass at pipes. works, but not very sophisticated