added piping, but it only works with certain conditions and freezes the program
hw 3 found a way around the bug in piping