Refactored pipes, added stuff to threading
Changes to control system