further changes to input/output, added thread names