Terrible implementation of pipes