added pipe check; renamed destructor dir to destructors, reference to references; cosmetics